From: Nobuyoshi Nakada Date: 2009-01-29T16:50:01+09:00 Subject: [ruby-core:21662] Re: [Feature #1046] request: ability to run without specifying .rb Hi, At Thu, 29 Jan 2009 05:11:16 +0900, Roger Pack wrote in [ruby-core:21646]: > > > |Oh sorry--I meant that you would probably find my answer [that I am lazy and > > |don't want to have to think when running ruby] as unsatisfying. > > > > That's the point. I have been a Ruby user for last 15 years, and I > > have never felt omitting extension help me being lazy. I am sure I am > > lazier than you are here. In fact, I am too lazy to think about .rb > > as a extension, it's only a part of file name unless it a library name > > (target of require). So there must be something help you by omitting > > extension. Could you explain how this help you to be lazy, unless you > > are too lazy? > > > > Tab issue is reasonable, but not strong enough, if I have "foo.rb", > > when I type "fo" then hit tab, I will get "foo.rb" anyway. It's > > highly dependent on how you choose file names. > > > good answer :) > > I like the suggestion to create a batch file [say r.bat] that handles > both cases that should work well. What about the suggestion by Luis Lavena at [ruby-core:21581]? > Another question: > > Is there a way to do this from the command line? > > require 2 files: > > $ ruby -rrubygems -rfacets -e '3' > ruby: no such file to load -- facets (LoadError) It's gem specific, and has gone in 1.9 as rubygems is built-in now. > Also is there a way to do something like > $ ruby -e 'initialization code' filename_run_after.rb ruby -e 'initialization code; load($0=ARGV.shift)' filename_run_after.rb -- Nobu Nakada