From 2b0611b9bb3259859b4776e672e5ef93a8b08620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 12 Mar 2010 20:40:34 +0100 Subject: Revert "Always load the environment before executing any command. [#3905 status:resolved]" This reverts commit 16846553b8866eab2aa3b128a2a23a221a25f7e3. --- railties/lib/generators/rails/app/templates/script/rails | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'railties/lib/generators/rails') diff --git a/railties/lib/generators/rails/app/templates/script/rails b/railties/lib/generators/rails/app/templates/script/rails index 199fe1a6d3..b01d1ee183 100644 --- a/railties/lib/generators/rails/app/templates/script/rails +++ b/railties/lib/generators/rails/app/templates/script/rails @@ -1,5 +1,8 @@ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. -ENV_PATH = File.expand_path('../../config/environment', __FILE__) -require File.expand_path('../../config/boot', __FILE__) +ENV_PATH = File.expand_path('../../config/environment', __FILE__) +BOOT_PATH = File.expand_path('../../config/boot', __FILE__) +APP_PATH = File.expand_path('../../config/application', __FILE__) + +require BOOT_PATH require 'rails/commands' -- cgit v1.2.3 From 9268b598bb20523e1b886f8811598647ce427ef9 Mon Sep 17 00:00:00 2001 From: Kieran Pilkington Date: Fri, 12 Mar 2010 21:24:56 +0100 Subject: Add a check to ensure that the application name does not already exist, i.e. String or Module are part of ruby [#3872 status:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/lib/generators/rails/app/app_generator.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'railties/lib/generators/rails') diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb index 92e0d37436..888e3b2ddd 100644 --- a/railties/lib/generators/rails/app/app_generator.rb +++ b/railties/lib/generators/rails/app/app_generator.rb @@ -220,6 +220,8 @@ module Rails::Generators raise Error, "Invalid application name #{app_name}. Please give a name which does not start with numbers." elsif RESERVED_NAMES.include?(app_name) raise Error, "Invalid application name #{app_name}. Please give a name which does not match one of the reserved rails words." + elsif Object.const_defined?(app_const_base) + raise Error, "Invalid application name #{app_name}, constant #{app_const_base} is already in use. Please choose another application name." end end -- cgit v1.2.3 From 94a60a5600269a9ce63eb8991c4deaa26cd0a7b6 Mon Sep 17 00:00:00 2001 From: Caio Chassot Date: Mon, 22 Feb 2010 04:09:51 -0300 Subject: In app_generator, fix hardcoded `bundle` call to derive the bundle executable name from Thor::Util.ruby_command. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that eg. when `rails` is called from `ruby1.9`, `bundle1.9` is called. Signed-off-by: José Valim --- railties/lib/generators/rails/app/app_generator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/generators/rails') diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb index 888e3b2ddd..1e1acc1141 100644 --- a/railties/lib/generators/rails/app/app_generator.rb +++ b/railties/lib/generators/rails/app/app_generator.rb @@ -178,7 +178,8 @@ module Rails::Generators end def bundle_if_dev_or_edge - run "bundle install" if dev_or_edge? + bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle') + run "#{bundle_command} install" if dev_or_edge? end protected -- cgit v1.2.3