Class: Runbook::CLI

Inherits:
Thor
  • Object
show all
Includes:
CLIBase
Defined in:
lib/runbook/cli.rb

Instance Method Summary collapse

Methods included from CLIBase

included, #initialize

Instance Method Details

#__print_versionObject



97
98
99
# File 'lib/runbook/cli.rb', line 97

def __print_version
  puts "Runbook v#{Runbook::VERSION}"
end

#exec(runbook) ⇒ Object



57
58
59
60
61
62
63
64
65
66
# File 'lib/runbook/cli.rb', line 57

def exec(runbook)
  runbook = _retrieve_runbook(runbook, :exec)
  Runbook::Runner.new(runbook).run(
    run: options[:run],
    noop: options[:noop],
    auto: options[:auto],
    paranoid: options[:"no-paranoid"] == nil,
    start_at: options[:start_at],
  )
end

#initObject



81
82
83
# File 'lib/runbook/cli.rb', line 81

def init
  invoke(Runbook::Initializer)
end

#installObject



91
92
93
94
# File 'lib/runbook/cli.rb', line 91

def install
  Runbook.deprecator.deprecation_warning(:install, :init)
  invoke(Runbook::Initializer)
end

#view(runbook) ⇒ Object



23
24
25
26
27
28
# File 'lib/runbook/cli.rb', line 23

def view(runbook)
  runbook = _retrieve_runbook(runbook, :view)
  puts Runbook::Viewer.new(runbook).generate(
    view: options[:view],
  )
end