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.



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

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

  options['require'].each {|lib| require(lib) }
end

Instance Method Details

#applyObject



44
45
46
47
48
49
# File 'lib/cronicle/cli.rb', line 44

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

#cleanupObject



52
53
54
55
56
57
# File 'lib/cronicle/cli.rb', line 52

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