• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

I added a new feature to irb_rocket. It's a simple utility for ease of daily irb use. Have you ever felt annoying for typing left cursor to enclose exprs by parens to be receiver like this?

   1  irb> 1 + 2 + 3  # Oh, I want to call "to_s"
   2  irb> (1 + 2 + 3 # back to the head
   3  irb> (1 + 2 + 3).to_s # return to the tail

I've experienced stuffs like this very often. Very annoying.

So I added the new feature named "irb_dollar" Its usage is simple, like this.

   1  irb> require "irb_dollar"
   2  irb> 1 + 2 + 3 $ to_s #=> "6"

Nice!

You can use "$" sign to make the left hand statement be receiver by installing irb_rocket version that is newer than 0.2.0

Enjoy :)

Links

posted by Png genki on Mon 3 Jan 2011 at 19:18

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry1874
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ