Ruby developers should be familiar with 10 tools

Source: Internet
Author: User

1. Git

Git is the first tool to be learned in the Ruby ecosystem. Almost all Ruby-developed kits are stored on Github. That is, whether you want to download or modify the collaboration, you need to use Git.

2. RVM

There are many implementation methods in Ruby, and many people are using them.

◆ Standard MRI Ruby 1.8.7

◆ Standard MRI Ruby 1.9.2

◆ REE (Ruby Enterprise Edition)

◆ JRuby and so on

In fact, it doesn't matter which version you use for development, but currently some projects can only be executed on Ruby 1.9.2. Switching the Ruby environment to run the experiment project was a pain point in the past.

Therefore, some people have invented RVM, allowing developers to easily switch to various Ruby environments, and even create an independent Gemset environment through RVM to experiment with new tools without any burden.

3. Mac

Mac is the first choice for developing Ruby programs.

The initial reason was the powerful tool for writing Ruby/Rails: TextMate http://marcomates.com/, a software on Mac. Later, more and more developers were using Mac to develop Ruby programs. In this case, almost all of the best practices and friendly development tools gave priority to Mac or the only platform, for example, Pow and Homebrew.

4. Homebrew

Originally on Mac, Suite management was almost the world of Macports And Fink. However, the dependency processing is poor, and sudo execution is required. Sometimes it may cause a suite management disaster. In the era after OSX 10.6, it was gradually replaced by Homebrew.

Homebrew has two outstanding points:

By user, you can install the suite without sudo. The file permissions will not be corrupted.

Update fast and clean. Homebrew is a git-based fomula set that uses the default fomula installer.

If an error is found during installation, you can modify it on your own, and send a pull request through Github to request the manager patch. The Rails Development Environment built with Homebrew is usually very clean and free of annoying suite bugs.

(Two major Rails developer kits that most often hit Thunder: MySQL and ImageMagick are installed on brew, which is almost no problem ...) [Limit 1]

5. Pow

This is a web server developed by 37 signals and can run any Rack-Based webpage program. The feature is that you can send a project, such as wiki and symlink, To the. pow/folder under your home directory.

 
 
  1. $ cd ~/.pow  
  2. $ ln -s ~/projects/wiki 

Then open http://wiki.dev/on the browser and you can hook up projects.

(Li intercepts requests sent back to Pow on port 80)

In the past, if you were to mount projects, you usually had to add the local apache conf and/etc/hosts settings. Pending, removing, and re-opening are all very troublesome.

The birth of Pow has made developers who often pursue many new things extremely low experimental costs.

6. Rack

Rack is a Ruby suite and a standard interface for Webpage Programs in the Ruby field. For the ideas and rationale behind it, refer to an old article I wrote earlier, Rack and Rack middleware.

Currently, almost all website programs developed using Ruby support Rack. There will no longer be any previous framework, and we recommend which web server is used exclusively for running chaos.

With Pow, the cost of suspending Rack-based website lab programs is also low.

At the same time, developers can use the plug-in Rack middleware to implement functions not available in the framework or program due to the Rack architecture development.

For example:

◆ Rack-now-www: the website's www is hard to be killed

◆ Rack-rewrite directly uses rack hard rewrite routing in an environment that does not support. htaccess

Naturally, you will know:

◆ Modify config.ru if you want to spoof it.

◆ To reopen, touch tmp/restart.txt

These hidden rules.

7. Bundler

Bundler was first developed by Yehuda Katz, Rails3 architect, to solve the package dependency in Rails (Katz started to implement it when developing the Merb framework ).

Package dependency is always quite troublesome. You cannot boot the program if it cannot be unlocked.

First, you can only use Bundler with Rails.

Later, Bundler gradually became the preset dependency manager in Ruby programs.

The Gemfile design in Bundler not only allows developers to easily solve the dependency problem of the suite, but also allows developers to directly introduce the "development in progress" suite to solve the problem of 3rd gem version updating being slow and getting stuck in their development progress.

 
 
  1. gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git' 
  2. gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git',:branch => 'stable-2' 
  3. gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git',:tag => 'tag-2' 
  4. gem 'nokogiri', :git => 'git://github.com/tenderlove/nokogiri.git',:ref => '23456' 

8. Guard

When developing a webpage program, developers often repeat this action: write a code and run test> refresh web browser> continue modification> run test> refresh browser.

These actions are very mechanical and annoying.

Is there a way to automatically perform operations as long as the file is changed?

Guard is such a set of tools.

Interestingly, when Guard was launched, it was just a set of tools to monitor changes in file tools. You can write Guardfile to freely monitor the folders to be monitored, and then do something. Because the Guard architecture is well designed, many developers developed more rubygems Based on Guard.

Guard-livereload is an example.

9. LiveReload

Modifying web page => refresh browser is one of the annoying things just mentioned.

LiveReload provides the ability to monitor file changes and notify browser reload.

If the screen is large enough, the developer can open a text editor and browser at the same time, and any changes to the changes will be immediately displayed on the browser.

It is worth mentioning that LiveReload is broken after 10.7. So someone later used guard to make guard-livereload as a substitute.

10. Sass/SCSS/Compass

Since the introduction of SCSS in Rails 3.1 as an option in Asset Pipeline, this set of CSS frameworks that few developers know has become crazy.

SCSS uses writing "nest-like" styles to replace the actions that need to repeat the DOM structure name during CSS writing. It also supports variables, mathematics, inheritance, mixin, and other functions...

For example:

SCSS

 
 
  1. $border-color: #3bbfce;  
  2.   $link-color: #3bbfcf;  
  3.   .content  
  4.      { border-color: $border-color;  
  5.        a{color: $link-color}  
  6.   } 

Generate

CSS

 
 
  1. .content{ border-color: #3bbfce; }  
  2. .content a{color: #3bbfcf; } 

Comass is a SCSS-based Framework. Provides many more violent feature features.

Some may be confused about SASS, SCSS, and Compass. If you are interested, refer to the two articles I wrote in The Upgrade2Rails31 project: Sass/SCSS and Compass.

Original article: http://blog.xdite.net/posts/2011/10/09/10-ruby-developer-must-have-tools/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.