Class: Rails::Generators::ARGVScrubber
- Inherits:
-
Object
- Object
- Rails::Generators::ARGVScrubber
- Defined in:
- lib/rails/generators/rails/app/app_generator.rb
Overview
This class handles preparation of the arguments before the AppGenerator is called. The class provides version or help information if they were requested, and also constructs the railsrc file (used for extra configuration options).
This class should be called before the AppGenerator is required and started since it configures and mutates ARGV correctly.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv = ARGV) ⇒ ARGVScrubber
constructor
:nodoc:.
- #prepare! ⇒ Object
Constructor Details
#initialize(argv = ARGV) ⇒ ARGVScrubber
:nodoc:
435 436 437 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 435 def initialize(argv = ARGV) @argv = argv end |
Class Method Details
.default_rc_file ⇒ Object
446 447 448 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 446 def self.default_rc_file File.('~/.railsrc') end |
Instance Method Details
#prepare! ⇒ Object
439 440 441 442 443 444 |
# File 'lib/rails/generators/rails/app/app_generator.rb', line 439 def prepare! handle_version_request!(@argv.first) handle_invalid_command!(@argv.first, @argv) do handle_rails_rc!(@argv.drop(1)) end end |