Module: RakeCommander::Patcher::Application::RunMethod::Patch
- Includes:
- Debug
- Defined in:
- lib/rake-commander/patcher/application/run_method.rb
Instance Method Summary collapse
-
#run(argv = ARGV) ⇒ Object
To extend the command line syntax we need to patch
Rake
, provided that this gem's extended options are not inargv
whenRake
processes it.
Methods included from Debug
#rake_comm_debug, #rake_comm_debug_main_object_id, #rake_comm_debug_random_object_id
Instance Method Details
#run(argv = ARGV) ⇒ Object
Note:
we define an instance variable so we can know if the patch was applied when it started.
Note:
This patch only works fine if Rake::Application#run
is invoked after**
RakeCommander
has been required.
- So by itself alone it allows to use
raked
executable that this gem provides.
To extend the command line syntax we need to patch Rake
, provided that
this gem's extended options are not in argv
when Rake
processes it.
33 34 35 36 37 38 39 40 41 |
# File 'lib/rake-commander/patcher/application/run_method.rb', line 33 def run(argv = ARGV) @rake_commander_run_argv_patch = true unless instance_variable_defined?(:@rake_commander_run_argv_patch) RakeCommander.self_load rake_comm_debug "R U N !", "\n", num: 1, pid: true rake_comm_debug " ---> Command: #{$PROGRAM_NAME}" rake_comm_debug " ---> ARGV: [#{argv.map {|a| "'#{a}'"}.join(', ')}]" argv = RakeCommander.argv_rake_native_arguments(argv) super(argv) end |