Can i do editing in the irb shell ?
irb(main):001:0> class MyClass
irb(main):002:1> def initialize(aStr)
irb(main):003:2> @avar = astr
irb(main):004:2> end
irb(main):005:1> def MyClass.new(aStr)
irb(main):006:2> @anewvar = aStr.swapcase
irb(main):007:2> end
irb(main):008:1> end
=> nil
irb(main):009:0> object = MyClass.new("ghazal")
=> "GHAZAL"
Is there any way i can go back to say line number 003 and add or delete a statement ?
It seems that irb doesn’t support such operations. Maybe you can work around the problem by using interactive_editor. With it you can start a vi editor from irb, after you quit the editor, the content you input will be saved and evaluated immediately by irb.
Please refer to the following page for details.
https://github.com/jberkel/interactive_editor