Class: Rukawa::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/rukawa/cli.rb

Instance Method Summary collapse

Instance Method Details

#_run(job_net_name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rukawa/cli.rb', line 15

def _run(job_net_name)
  Rukawa.configure do |c|
    c.log_file = options[:log]
    c.concurrency = options[:concurrency] if options[:concurrency]
  end
  load_job_definitions

  job_net_class = Object.const_get(job_net_name)
  job_net = job_net_class.new(options[:variables])
  result = Runner.run(job_net, options[:batch], options[:refresh_interval])

  if options[:dot]
    job_net.output_dot(options[:dot])
  end

  exit 1 unless result
end

#graph(job_net_name) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/rukawa/cli.rb', line 36

def graph(job_net_name)
  load_job_definitions

  job_net_class = Object.const_get(job_net_name)
  job_net = job_net_class.new(options[:variables])
  job_net.output_dot(options[:output])
end