homeASCIIcasts

195: Favourite Web Apps in 2009 

(view original Railscast)

Other translations: Es It

This week’s episode will be a little different from normal in that we’re going to show you some of the best web applications for Rails developers in 2009. All of the following applications will help you improve your Rails apps in some way or other. Let’s jump straight in with the first one.

Github

The Github home page.

The first app on the list should require no introduction: Github. If you’re a programmer then you really should be using it. Github has several features that are less well-known but still useful, for example Gists which are handy ways to share code snippets. Github’s help section is also worth taking a look as it contains a wealth of articles to help you get the most from Git and Github.

Gemcutter

The Gemcutter home page.

The second app in our list is Gemcutter which is the ultimate place to host your RubyGems. Gemcutter was covered back in episode 183 [watch, read], but since then it has become even easier to use. Previously you had to call the gem tumble command to install gems from Gemcutter but this is no longer necessary as the gem hosting on RubyForge now points to Gemcutter making it the best place to install Gems from.

What makes Gemcutter so valuable is the ease with which it allows you to publish your own gems. It takes just the three steps listed in the screenshot above. The only potentially tricky part is creating a gemspec file but that can be made easier by using another gem’s gemspec file as a template. A good example is the gemspec file for Ryan Bates’ CanCan gem.

Gem::Specification.new do |s|
  s.name = "cancan"
  s.summary = "Simple authorization solution for Rails."
  s.description = "Simple authorization solution for Rails which is completely decoupled from the user's roles. All permissions are stored in a single location for convenience."
  s.homepage = ""
  
  s.version = "1.0.2"
  s.date = "2009-12-30"
  
  s.authors = ["Ryan Bates"]
  s.email = "ryan@railscasts.com"
  
  s.require_paths = ["lib"]
  s.files = Dir["lib/**/*"] + Dir["spec/**/*"] + ["LICENSE", "README.rdoc", "Rakefile", "CHANGELOG.rdoc", "init.rb"]
  s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "LICENSE"]
  
  s.has_rdoc = true
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "CanCan", "--main", "README.rdoc"]
  
  s.rubygems_version = "1.3.4"
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2")
end

A gemspec file like the one above can be edited to suit your own project. The file is easy to change directly whenever you create a new version of your gem and you can then build and push to release the new version.

Caliper

The Caliper home page.

Next up is Caliper. You might remember that back in episode 166 [ watch, read] we covered the metric_fu gem. Caliper is basically an online version of metric_fu and is a great way to gather metric information about any Rails application that is hosted in a Git repository. To use it you just need to enter the URL of the repository and within a few seconds it will return all of the metric information for that project.

747

You can view information about test/code ratios, code smells and many other details about your Rails applications so that you can help improve your code or use it to examine other projects you’re interested in. If you find a gem or plugin you want to use you can run it through Caliper to find out how large the codebase is and how well it has been designed and written.

Rdoc.info

The rdoc.info home page.

Another useful site is rdoc.info. If you’re looking for documentation for a given Ruby project on Github, try this site and look for the project you’re interested in. If it’s not listed you can add it and the RDocs will be generated and made available.

RunCodeRun

The RunCodeRun home page.

Another great application is RunCodeRun, which is a simple continuous integration server. Just point it at an application in a Github repository and it will run that app’s tests and report back on whether they pass or fail. RunCodeRun is free for public repositories and is well worth trying out. Once it has run the tests you can browse the projects and see which ones pass or fail.

RunCodeRun uses your application’s default rake task to run the tests. This means that you can alter this task to do whatever you want it to. In your application’s Rakefile you could point it to the :spec and :features tasks so that the Rspec and Cucumber features are run.

task :default => [:spec, :features]

The Ruby Toolbox

The Ruby Toolbox home page.

The Ruby Toolbox is a great resource. Often when you’re developing a new Rails application you’re left wondering which gem or plugin to use for a certain task. The Ruby Toolbox is an excellent way to find out which gems or plugins are available for handling different categories of task. For example if your application requires versioning you can find a list of the available projects and how to use them.

New Relic

The New Relic home page.

Another application that you should be using in any production Rails applications you have is NewRelic RPM. This is a immensely useful application for finding performance issues in your applications to ensure that it’s running smoothly and to help keep it that way. Even the free version, RPM Lite, provides enough information to enable to find the bottlenecks in your application and to monitor how well it is running.

Learnivore

The Learnivore home page.

If you’re a fan of screencasts then Learnivore is a great site. There are a large number of both free and paid screencasts aggregated there including Railscasts. Learnivore is a resource well worth checking out.

Finally Ryan kindly mentioned ASCIIcasts as one of his favourite sites but as you’re already here you already know all there is to know about it.