Permalink
Browse files

Rails Runner now sets $0 and $PROGRAM_NAME to name of file being run [#…

…2244 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 9be0b50 commit 40bf76165c392a15cd74321dd7d1cbc96c77bd27 @rohit rohit committed with josevalim Jun 22, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 railties/lib/rails/commands/runner.rb
@@ -44,6 +44,7 @@
$stderr.puts "Run '#{$0} -h' for help."
exit 1
elsif File.exist?(code_or_file)
+ $0 = code_or_file
eval(File.read(code_or_file), nil, code_or_file)
else
eval(code_or_file)

0 comments on commit 40bf761

Please sign in to comment.