LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-18-2009, 08:45 PM   #1
darenw
Member
 
Registered: Mar 2009
Location: Very humid Central Florida
Distribution: ArchLinux
Posts: 30

Rep: Reputation: 1
Strangeness pasting ruby code into irb command line


Someone please explain this phenomenon. I have some ruby code in a text file. When I paste it line by line into an irb session, no problem. When I select the whole chunk of code and paste it all at once, some extra stuff is printed. Maybe I've forgotten some basic point, but for now I am puzzled. I'm running Arch linux, bash shell in rxvt, ruby 1.9.1, irb 0.9.5, and pasting using the mouse middle button (the wheel)

The ruby code ("Ref" was already defined earlier):

class HorRef < Ref
def initialize(number_of_lines=1)
super(number_of_lines)
end
end



What appears in the xterm running an irb session. The first attempt was line by line. The second, it appears an 'ls' command was run.


irb(main):130:0> class HorRef < Ref
irb(main):131:1> def initialize(number_of_lines=1)
irb(main):132:2> super(number_of_lines)
irb(main):133:2> end
irb(main):134:1> end
=> nil

irb(main):135:0> class HorRef < Ref
irb(main):136:1> def initialize(number_of_lines=1)
irb(main):137:2>
3dscope_schem.aux 3dscope_schem.tex~ dsweparts.ps~
3dscope_schem.dvi Stereoscopic8x8x8.ps puresine1.ps
3dscope_schem.log draw_stereo888.rb puresine_2009redo.ps
3dscope_schem.pdf draw_stereo888.rb~ puresine_2009redo.ps~
3dscope_schem.tex dsweparts.ps xtest/
irb(main):137:2> super(number_of_lines)
irb(main):138:2> end
irb(main):139:1> end
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the source code of command line ? the_cpp Programming 6 01-24-2009 09:01 AM
Executing command line through Code socialjazz Programming 2 10-02-2006 03:09 PM
posting code from command line frankie_DJ Linux - Newbie 3 08-09-2005 08:51 AM
automatic code pasting verve Programming 3 10-07-2002 12:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration