From 0f0d926def0fd2e5ce806e5a413d12c007dd3b47 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 6 Apr 2006 03:17:42 +0000 Subject: Fixed that the -r/--ruby path option of the rails command was not being respected (closes #4549) [ryan.raaum@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4177 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../rails_generator/generators/applications/app/app_generator.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails_generator/generators/applications/app/app_generator.rb') diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index b07133240b..f1f800cf74 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -17,7 +17,8 @@ class AppGenerator < Rails::Generator::Base end def manifest - script_options = { :chmod => 0755 } + # Use /usr/bin/env if no special shebang was specified + script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] } dispatcher_options = { :chmod => 0755, :shebang => options[:shebang] } record do |m| @@ -93,8 +94,8 @@ class AppGenerator < Rails::Generator::Base def add_options!(opt) opt.separator '' opt.separator 'Options:' - opt.on("-r", "--ruby", String, - "Path to the Ruby binary of your choice.", + opt.on("-r", "--ruby=path", String, + "Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).", "Default: #{DEFAULT_SHEBANG}") { |options[:shebang]| } opt.on("-d", "--database=name", String, -- cgit v1.2.3