Les Is More
Updated: 31 Jul 2012
The Rails console makes it pretty hard to see whats going on when you dump a model. IRBTools includes Hirb which will format Active Record output into pretty tables. Unfortunately those tables don't resize with the console resizing, but on unixy systems like Linux and OSX you can do a little hack to fix that.
This is my .irbrc file. Some save-history settings and the Signal.trap, which will tell Hirb to resize when the terminal resizes:
1 2 3 4 5 6 |
require 'irb/ext/save-history' IRB.conf[:SAVE_HISTORY] = 200 IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history" Signal.trap('SIGWINCH', proc { y, x = `stty size`.split.map(&:to_i); Hirb::View.resize(x, y) } ) |
This requires these handy gems in your Gemfile:
1 2 3 |
gem 'irbtools' gem 'irbtools-more' |
This is the website of Leslie Viljoen. More info
2021
March
2015
September
2014
December
September
July
April
March
February
January
2013
April
March
January
2012
July
2011
April
2008
January