Class: Cronicle::CLI

Inherits:
Thor
  • Object
show all
Includes:
Logger::Helper
Defined in:
lib/cronicle/cli.rb

Instance Method Summary collapse

Methods included from Logger::Helper

#log

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 options['debug']
    Cronicle::Logger.instance.set_debug(true)
  end

  if not $stdin.tty? or not options['color']
    String.disable_colorization = true
  end
end

Instance Method Details

#applyObject



41
42
43
44
45
46
# File 'lib/cronicle/cli.rb', line 41

def apply
  with_logging do
    set_ssh_options
    client.apply(jobfile)
  end
end

#cleanupObject



49
50
51
52
53
54
# File 'lib/cronicle/cli.rb', line 49

def cleanup
  with_logging do
    set_ssh_options
    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
    set_ssh_options
    client.exec(jobfile, job_name)
  end
end