1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #1631 from vijaydev/runner-help

rails runner without any options should show usage information
This commit is contained in:
José Valim 2011-06-10 06:45:52 -07:00
commit 8eb2b519f2
2 changed files with 8 additions and 0 deletions

View file

@ -4,6 +4,10 @@ require 'rbconfig'
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 file

@ -22,6 +22,10 @@ module ApplicationTests
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