From: Henning Bekel Date: 2008-09-18T01:57:31+09:00 Subject: Re: Calling a Method 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. Is this what you mean? henning@box:~$ cat test.rb def bar(p=ARGV[0]) puts "bar called with parameter '#{p}'" end henning@box:~$ ruby -rtest -e 'bar' Hello bar called with parameter 'Hello'