Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1631 from vijaydev/runner-help

rails runner without any options should show usage information
  • Loading branch information...
commit 8eb2b519f267e61edcf1e715489c3c9ac0244d81 2 parents 78acd17 + 880371e
@josevalim josevalim authored
View
4 railties/lib/rails/commands/runner.rb
@@ -4,6 +4,10 @@
options = { :environment => (ENV['RAILS_ENV'] || "development").dup }
code_or_file = nil
+if ARGV.first.nil?
+ ARGV.push "-h"
+end
+
ARGV.clone.options do |opts|
script_name = File.basename($0)
opts.banner = "Usage: runner [options] ('Some.ruby(code)' or a filename)"
View
4 railties/test/application/runner_test.rb
@@ -22,6 +22,10 @@ def teardown
teardown_app
end
+ def test_should_include_runner_in_shebang_line_in_help_without_option
+ assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner` }
+ end
+
def test_should_include_runner_in_shebang_line_in_help
assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner --help` }
end
Please sign in to comment.
Something went wrong with that request. Please try again.