Class: Charyf::Generators::ARGVScrubber
- Defined in:
- lib/charyf/utils/generators/app/app_generator.rb
Overview
This class handles preparation of the arguments before the AppGenerator is called.
This class should be called before the AppGenerator is required and started since it configures and mutates ARGV correctly.
Constant Summary collapse
- VERSION_ARGS =
:nodoc:
%w(--version -v)
Instance Method Summary collapse
-
#initialize(argv = ARGV) ⇒ ARGVScrubber
constructor
A new instance of ARGVScrubber.
- #prepare! ⇒ Object
Constructor Details
#initialize(argv = ARGV) ⇒ ARGVScrubber
Returns a new instance of ARGVScrubber.
245 246 247 |
# File 'lib/charyf/utils/generators/app/app_generator.rb', line 245 def initialize(argv = ARGV) @argv = argv end |
Instance Method Details
#prepare! ⇒ Object
250 251 252 253 254 255 |
# File 'lib/charyf/utils/generators/app/app_generator.rb', line 250 def prepare! handle_version_request!(@argv.first) handle_invalid_command!(@argv.first, @argv) do return @argv.drop(1) end end |