From: Nathan Powell Date: 2008-09-18T01:32:48+09:00 Subject: Re: Calling a Method On Thu, Sep 18, 2008 at 01:28:15AM +0900, Rong wrote: > If I have a file that contains a method that takes one parameter. and > I want to call the method from the command line, how do you do that? > I know how to run a script from the command line but not how to call a > method. I'll be interested to see if there is a better way to do this... npowell@delilah ~ $ cat test.rb class Foo def bar puts "Oh Hai!" end end npowell@delilah ~ $ ruby -e 'require "test"; f = Foo.new; f.bar;' Oh Hai! -- nathan nathan_at_nathanpowell_dot_org Trust no thought arrived at sitting down. ~ George Sheehan ------------------------------------