When selecting lines of text I wish to test interactively then pasting them with a middle-mouse click into the IRB prompt,
I have to press enter for every line of code entered, and only then does IRB register the input. A normal IRB running
in a terminal does not have this problem. My problem looks like this (I'm not far in the pickaxe book as you can see,
I'm still quite a nuby :P):
irb(main):001:0> class Songlist
def initialize
@songs = Array.new
end
def append(aSong)
@songs.push(aSong)
self
end
def deleteFirst
@songs.shift
end
def deleteLast
@songs.pop
end
end
class Songlist
irb(main):002:1>
def initialize
irb(main):003:2>
@songs = Array.new
irb(main):004:2>
end
irb(main):005:1>
def append(aSong)
irb(main):006:2>
@songs.push(aSong)
irb(main):007:2>
self
irb(main):008:2>
end
irb(main):009:1>
def deleteFirst
irb(main):010:2>
@songs.shift
irb(main):011:2>
end
irb(main):012:1>
def deleteLast
irb(main):013:2>
@songs.pop
irb(main):014:2>
end
irb(main):015:1>
end
=> nil
At every irb prompt I must press enter again for it to register the big chunk of code i fed it at the start. |