diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 14:55:15 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 14:55:15 -0700 |
commit | 8d9310db943ba647452ad23669e268a61e9d3750 (patch) | |
tree | 492dd168716dbef357f521898db2d2bbf9007363 | |
parent | e83989b5a79c264966ce07e5f4a1e160399505f6 (diff) | |
download | rails-8d9310db943ba647452ad23669e268a61e9d3750.tar.gz rails-8d9310db943ba647452ad23669e268a61e9d3750.tar.bz2 rails-8d9310db943ba647452ad23669e268a61e9d3750.zip |
rename AppPreparer
AppPreparer doesn't actually prepare applications, it scrubs ARGV.
Let's also get the class under test while we're at it
-rw-r--r-- | railties/lib/rails/commands/application.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/base.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 4 |
4 files changed, 5 insertions, 3 deletions
diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb index 678697f09b..04a4f292a0 100644 --- a/railties/lib/rails/commands/application.rb +++ b/railties/lib/rails/commands/application.rb @@ -13,5 +13,5 @@ module Rails end end -Rails::Generators::AppPreparer.new(ARGV).prepare! +Rails::Generators::ARGVScrubber.new(ARGV).prepare! Rails::Generators::AppGenerator.start diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 3731be38ae..5da8a73e2e 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -5,6 +5,7 @@ require 'rails/version' unless defined?(Rails::VERSION) require 'rbconfig' require 'open-uri' require 'uri' +require 'rails/generators/base' module Rails module Generators diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 8aec8bc8f9..681332a144 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -7,6 +7,7 @@ rescue LoadError exit end +require 'rails/generators' require 'rails/generators/actions' module Rails diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 6927cc52dd..849d6112ab 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -311,7 +311,7 @@ module Rails # # This class should be called before the AppGenerator is required and started # since it configures and mutates ARGV correctly. - class AppPreparer # :nodoc + class ARGVScrubber # :nodoc attr_reader :argv def initialize(argv = ARGV) @@ -329,7 +329,7 @@ module Rails private def handle_version_request!(argument) - if ['--version', '-v'].include?(argv.first) + if ['--version', '-v'].include?(argument) require 'rails/version' puts "Rails #{Rails::VERSION::STRING}" exit(0) |