I''ve run into a problem when using script/runner with a gem that uses optparse (namely, twibot). If I use: script/runner -e production my_script.rb , the twibot end blows up because it doesn''t recognize the "-e" option, which stays in ARGV after script/runner has used it. Of course this can be easily solved using "RAILS_ENV=production" instead of "-e production", but I think letting runner pass down the "- e" to the script being run is inconsistent, since it does delete code_or_file from ARGV (line 34). Is this behavior intentional, or can I write a patch to fix it? Cheers, Helder Ribeiro http://helderribeiro.net
Michael Koziarski
2009-Sep-08 03:49 UTC
Re: Removing used options from ARGV on script/runner
> Is this behavior intentional, or can I write a patch to fix it?I don''t believe it''s intentional, it should really be removing everything before the script name / script body from ARGV. Please do send in a patch, sounds like a nice little fix. -- Cheers Koz