Thursday, May 12, 2011

Flyrb

Found a nifty gem the other day called utility_belt. It's actually pretty old, back to about 2006 or so. I thought the idea of being able to use VI to edit some code and have it run in the console without ever really leaving the console was an excellent idea. Only problem was the library hadn't been updated since 2008, which means I couldn't use it in Ruby 1.9.. Gay.
I eventually found a new little gem called FlyRB, which is a fork of utility_belt but it's 1.9 compatible.
Now, I need to figure out how to get flyrb to work in the rails/daemon_kit console without having to put it in the Gemfile (~/.irbrc doesn't seem to do the trick in anything but irb).

Utility Belt
FlyRB

2 comments:

  1. Does it work? I tried (1..3).map(&'*2') from the examples given, but no luck.

    ReplyDelete
  2. ruby-1.9.2-p180 :005 > (1..3).map(&:'*2')
    NoMethodError: undefined method `*2' for 1:Fixnum
    from (irb):5:in `each'
    from (irb):5:in `map'
    from (irb):5
    from /Users/foobar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/console.rb:44:in `start'
    from /Users/foobar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/console.rb:8:in `start'
    from /Users/foobar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:23:in `'
    from script/rails:6:in `require'
    from script/rails:6:in `'

    ReplyDelete