Module: Dronejob::Modules::Core
Instance Method Summary collapse
- #ask(*args) ⇒ Object
- #breakpoint ⇒ Object
- #perform(params) ⇒ Object
- #say(*args) ⇒ Object
- #shell ⇒ Object
Instance Method Details
#ask(*args) ⇒ Object
24 25 26 |
# File 'lib/dronejob/modules/core.rb', line 24 def ask(*args) shell.ask(*args) end |
#breakpoint ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/dronejob/modules/core.rb', line 32 def breakpoint if param(:break) say(" ", [Thor::Shell::Color::WHITE, Thor::Shell::Color::ON_BLACK], true) say(" BREAKPOINT ACTIVATED ", [Thor::Shell::Color::WHITE, Thor::Shell::Color::ON_BLACK, Thor::Shell::Color::BOLD], true) say(" PRESS RETURN TO CONTINUE ", [Thor::Shell::Color::WHITE, Thor::Shell::Color::ON_BLACK], true) say(" ", [Thor::Shell::Color::WHITE, Thor::Shell::Color::ON_BLACK], false) ask("") end end |
#perform(params) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/dronejob/modules/core.rb', line 10 def perform(params) @job_params = params.to_h @job_identifier = Dronejob::Loader.identifier_for(self) self.params = params validate_parameters! run_callbacks :job do run_phases end end |
#say(*args) ⇒ Object
28 29 30 |
# File 'lib/dronejob/modules/core.rb', line 28 def say(*args) shell.say(*args) end |
#shell ⇒ Object
20 21 22 |
# File 'lib/dronejob/modules/core.rb', line 20 def shell @shell ||= Thor::Shell::Color.new end |