Hi. I'm calling a script from the command line using script/runner. The script registers some files which are manipulated using ImageMagick's tools. The script uses today's date to scan a directory. Sometimes I need to scan a directory which dates two-three days back. I tried to use the following code which does *not* work: time = Time.now @date = time.strftime("%Y-%m-%d") unless @date = ARGV In this case the script won't insert records in the db. I had to change the line to: @date = time.strftime("%Y-%m-%d") This is fine as long as I don't have to register orders in the past. The script is called from crontab using: ruby ./script/runner -e production 'require "./register_orders.rb"' I tried to do a 'register_orders.rb 2006-02-28' so ARGV would become the date. But this prevents register_orders.rb from inserting any records, regardless of the code above. Is there any way that I can pass a parameter using script/runner 'require "my_script param1"'? Or by some other means call it and point to a date in the past? regards Claus
on 2006-03-02 11:30
on 2006-03-02 12:32
On Mar 2, 2006, at 10:30, Claus G. wrote: > ruby ./script/runner -e production 'require "./register_orders.rb"' Why there's no way to pass a script directly to runner?