irb hacks
Along the same lines as @tiegz's protip, mine lets you easily bring up an object in less
so you can move around the object easily and most importantly search for things:
Just add this to your ~/.irbrc
def less(x)
IO.popen( 'less -', 'w') do |io|
io.puts x.to_yaml
end
end
Then in an IRB session (this one is a rails console session), do something like this:
irb(main):003:0> less User.all
And you'll have your users, in YAML, in less.
Written by Jason King
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#