Reader small image

You're reading from  Instant RubyMine Assimilation

Product typeBook
Published inNov 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781849698764
Edition1st Edition
Languages
Right arrow
Author (1)
David L. Jones
David L. Jones
author image
David L. Jones

Dave Jones is a developer and teacher living in Spokane, Washington. He has worked with many of the top Fortune 500 companies during the last 30 years of his career. Dave has a Bachelor of Science degree in Computer Science from Cal Poly, Pomona and has a Masters of Technology Management degree from Pepperdine University. He has always had a love for computers. He started his career by fixing Apple computers in the early 1980s. He continued on his career path by working at Rockwell Space Division where he had the opportunity to work on various Space Shuttle ground and control systems. Dave continued his varied career by entering into the burgeoning Internet software industry, where he worked on developing white-label forum/bulletin board systems for many different startup companies. Some of these companies included Apple Computer, Microsoft, WebMD, Cisco, New York Times, UK Guardian, Dr. Phil and Oprah shows, Citicorp, Reader's Digest, Edmunds.com, Sony, Kodak, and many other fortune 500 companies. Throughout this interesting career, he was able to learn many of the technologies that are in use today and decided that he wanted to give back to the software community by teaching some of his life-long skills to new developers beginning their new careers. Dave began teaching at a Spokane Community college in the Software Development department in 2008. He currently teaches many different technologies including Ruby, Ruby on Rails, PHP, Agile development, CSS/HTML, JavaScript, jQuery, mobile development with Java on the Android OS, as well as Objective-C on Apple iOS devices. He records his lectures and makes them publically available on YouTube where thousands of developers around the world are benefiting from his expertise. He is also the owner of a small software consulting company that helps pay for his teaching hobby. Dave has a passion for computers, Internet, and building software. He truly enjoys the interaction and satisfaction that comes from the creation of software tools.
Read more about David L. Jones

Right arrow

Ensuring your legacy (Become an expert)


There is nothing worse than losing code that you have spent eons writing. RubyMine has some nice built-in tools to manage your version control systems including Subversion and GIT repositories.

Getting ready

Open your Progeny Rails project in RubyMine.

Depending on your OS, download and install Subversion and GIT as follows:

  • For the Mac OS, subversion is already installed on the Mac OS X versions.

  • Git can be installed by downloading the installer for your version of OS X. The images can be found at https://code.google.com/p/git-osx-installer/.

  • Follow the instructions for the installer.

  • For Windows, Subversion can be downloaded and installed by running the appropriate installer for your system from http://tortoisesvn.net/downloads.html.

  • Git can be installed through the installer http://msysgit.github.io/.

  • Follow the instructions for the installer.

  • For Linux OS, subversion can be installed by opening a terminal window and typing:

    sudo apt-get install subversion
    
  • Git can be installed by typing the following command in a terminal window:

    sudo apt-get install git
    

How to do it...

Now that we have subversion and Git installed, we can tell RubyMine which version control system that we want to use for our project. Let's start with Git:

  1. Navigate to VCS | Enable Version Control System...

    This will bring up a little window that will let us choose which VCS to use for this particular project. We can have different VCSs for each project that we have in RubyMine, as shown in the following screenshot:

  2. Select OK. This will initiate the Git system and automatically issue the command git init on your project.

  3. Expand some folders. You will see that all of the files are now color coded in red. This means that the files are not yet under version control, so we need to add them to our local Git repository. This takes two steps: Adding the files and committing the files.

  4. To add the entire project, click on the frame panel button at the bottom of the project called 9: Changes.

  5. Click on the link Click to Browse which is next to Unversioned Files. A new window will open with a list of files in the project.

  6. Select the top-level folder and hit the green + button on the left of this window. This will add all of the files and folders to the project under the Git staging system. As shown in the following screenshot, the project window will now show all the files with a green color, which means the files are added to the local Git repository, but they have not yet been committed:

Now all we need to do is commit the directory using the following steps:

  1. Right-click on the project folder in the project list and navigate to Git | Commit Folder. This will bring up a window like the following:

    From this window, we can select many options, but the most important is to add a comment in the bottom text box. This comment will follow this commit forever.

  2. Type Initial Project Commit in this box.

  3. Hit the button Commit in the bottom-right corner. This will add the files to the Git repository and we can now see that all the files have returned to a black color in the project window. This means that all the files are now under version control. If we make a change to a file, the color will change appropriately. From now on, we can add single files and commit them either individually or as a group, just like the initial commit.

Now let's see how to view changes from different files versus our committed repository changes:

  1. Add the following comment line to our species.rb file from app | models above the method that we created earlier:

    # Return a status string of a particular species
  2. Save the file.

  3. Right-click on the opened file and navigate to Git | Compare with Latest Repository Version. This will show us a window with both versions of the file shown next to each other with insertion and deletions from both versions to show exactly what is different between the two files, as you can see in the following screenshot:

There's more…

The subversion and other version control systems that RubyMine integrates with are basically the same in operation. Explore the subversion system or any other VCS systems that you might be familiar with. Just remember to use one of them to maintain your legacy and not lose your best work.

There are many more controls that you can use with your VCS including comparing full directories, pushing your changes to a remote repository, creating patches, viewing and creating branches, and even integration with GitHub. Feel free to explore all these options on your own.

Previous PageNext Page
You have been reading a chapter from
Instant RubyMine Assimilation
Published in: Nov 2013Publisher: PacktISBN-13: 9781849698764
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
David L. Jones

Dave Jones is a developer and teacher living in Spokane, Washington. He has worked with many of the top Fortune 500 companies during the last 30 years of his career. Dave has a Bachelor of Science degree in Computer Science from Cal Poly, Pomona and has a Masters of Technology Management degree from Pepperdine University. He has always had a love for computers. He started his career by fixing Apple computers in the early 1980s. He continued on his career path by working at Rockwell Space Division where he had the opportunity to work on various Space Shuttle ground and control systems. Dave continued his varied career by entering into the burgeoning Internet software industry, where he worked on developing white-label forum/bulletin board systems for many different startup companies. Some of these companies included Apple Computer, Microsoft, WebMD, Cisco, New York Times, UK Guardian, Dr. Phil and Oprah shows, Citicorp, Reader's Digest, Edmunds.com, Sony, Kodak, and many other fortune 500 companies. Throughout this interesting career, he was able to learn many of the technologies that are in use today and decided that he wanted to give back to the software community by teaching some of his life-long skills to new developers beginning their new careers. Dave began teaching at a Spokane Community college in the Software Development department in 2008. He currently teaches many different technologies including Ruby, Ruby on Rails, PHP, Agile development, CSS/HTML, JavaScript, jQuery, mobile development with Java on the Android OS, as well as Objective-C on Apple iOS devices. He records his lectures and makes them publically available on YouTube where thousands of developers around the world are benefiting from his expertise. He is also the owner of a small software consulting company that helps pay for his teaching hobby. Dave has a passion for computers, Internet, and building software. He truly enjoys the interaction and satisfaction that comes from the creation of software tools.
Read more about David L. Jones