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.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cronicle/cli.rb', line 21 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 ['require'].each {|lib| require(lib) } end |
Instance Method Details
#apply ⇒ Object
44 45 46 47 48 49 |
# File 'lib/cronicle/cli.rb', line 44 def apply with_logging do client.apply(jobfile) end end |
#cleanup ⇒ Object
52 53 54 55 56 57 |
# File 'lib/cronicle/cli.rb', line 52 def cleanup with_logging do client.cleanup end end |
#exec(job_name) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/cronicle/cli.rb', line 36 def exec(job_name) with_logging do client.exec(jobfile, job_name) end end |