The state_machine gem comes with a rake task that lets you generate PNG graphs from any model using state...

makandra dev
blog.rubybestpractices.com

class Errormaster CoffeeIsOut = Class.new(StandardError) # is prettier than class CoffeeIsOut < StandardError; end end Reference such an error class with Errormaster...

github.com

Grit gives you object oriented read/write access to Git repositories via Ruby.

weblog.rubyonrails.org

jQuery as new default Javascript library, streaming response support, attr_accessible with roles, prepared statements, easier migrations.

If you have a time given in a different time zone than your local one, parsing will convert it for...

I believe that when WEBrick has trouble bringing up your Rails application, the WEBrick component that is supposed to print...

If you have any class which requires access to some path methods generated by your routes. Even though you could...

While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals...

You've been there: A form cannot be submitted, but you don't see a validation error because the field...

Calling Time#utc, Time#gmt or Time#localtime will not create a converted copy. Instead these methods modify the receiving...

I recently browsed through the ActiveSupport code and found some nice stuff I did not know about: ActiveSupport::Callbacks

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...

Date::Performance is a gem that replaces various method in Ruby's Date class with fast C implementations. Unfortunately it...

When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...

makandra dev
github.com

When you need to use diff in either some Ruby code or your Rails app, use the differ gem.

makandra dev
web.archive.org

When you need to zip up files in Ruby, use zipruby. sudo gem install zipruby You can add existing files...

To offer files for download, use send_file. def download(file) send_file file.path, :disposition => 'attachment' end

Note: If you are currently working with Ruby 1.8.7 or 1.9.3, we recommend to upgrade to Ruby 2.1 first. From...

File.chmod(0604, '/path/to/file') # rw----r-- The leading zero is meaningful.

If you use Selenium and Launchy to open web pages, you might run into an error saying "Your Firefox profile...

We usually generate our commit messages from Pivotal Tracker IDs and titles, like [#15775609] Index view for conflicts

Sometimes you need a file of some size (possibly for testing purposes). On Linux, you can use dd to create...

robots.thoughtbot.com

We are changing our name from Hoptoad to Airbrake. You see, some folks much larger than us reached out and...

Regular expressions can have something called "zero-width look-behind assertions". This means that you want a pattern to be...