Class: Cronicle::CLI
- Inherits:
-
Thor
- Object
- Thor
- Cronicle::CLI
- Includes:
- Logger::Helper
- Defined in:
- lib/cronicle/cli.rb
Instance Method Summary collapse
- #apply ⇒ Object
- #cleanup ⇒ Object
- #exec(job_name) ⇒ Object
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
Methods included from Logger::Helper
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cronicle/cli.rb', line 20 def initialize(*args) super if ['debug'] Cronicle::Logger.instance.set_debug(true) end if not $stdin.tty? or not ['color'] String.disable_colorization = true end end |
Instance Method Details
#apply ⇒ Object
41 42 43 44 45 46 |
# File 'lib/cronicle/cli.rb', line 41 def apply with_logging do client.apply(jobfile) end end |
#cleanup ⇒ Object
49 50 51 52 53 54 |
# File 'lib/cronicle/cli.rb', line 49 def cleanup with_logging do client.cleanup end end |
#exec(job_name) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/cronicle/cli.rb', line 33 def exec(job_name) with_logging do client.exec(jobfile, job_name) end end |