From e0a4d8be93b1bfa17cbf1fb87947d7b12049ddc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 17 Jun 2009 19:48:25 +0200 Subject: [PATCH] Fix shebang on created files. --- railties/lib/generator/generators/app.rb | 6 +----- railties/lib/generator/templates/app/config/environment.rb | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/railties/lib/generator/generators/app.rb b/railties/lib/generator/generators/app.rb index 86e662d27c..101727de7a 100644 --- a/railties/lib/generator/generators/app.rb +++ b/railties/lib/generator/generators/app.rb @@ -185,12 +185,8 @@ module Rails::Generators ActiveSupport::SecureRandom.hex(64) end - def freeze - options[:freeze] - end - def shebang - options[:ruby] || "#!/usr/bin/env ruby" + "#!#{options[:ruby] || "/usr/bin/env ruby"}" end def mysql_socket diff --git a/railties/lib/generator/templates/app/config/environment.rb b/railties/lib/generator/templates/app/config/environment.rb index d4e2c9bdff..6a4db65e8f 100644 --- a/railties/lib/generator/templates/app/config/environment.rb +++ b/railties/lib/generator/templates/app/config/environment.rb @@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file # Specifies gem version of Rails to use when vendor/rails is not present -<%= '# ' if freeze %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>' unless defined? RAILS_GEM_VERSION +<%= '# ' if options[:freeze] %>RAILS_GEM_VERSION = '<%= Rails::VERSION::STRING %>' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot')