Class: Spaux::CLI

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

Instance Method Summary collapse

Instance Method Details

#convergeObject



12
13
14
15
16
17
18
# File 'lib/spaux/cli.rb', line 12

def converge
  work_dir = get_work_dir(options)
  FileUtils.mkdir_p work_dir

  client = Spaux::Chef::Client.new(work_dir)
  client.run
end

#knife(*args) ⇒ Object



33
34
35
36
37
# File 'lib/spaux/cli.rb', line 33

def knife(*args)
  work_dir = get_work_dir(options)
  knife = Spaux::Chef::Knife.new(work_dir, args)
  knife.run
end

#savekeyObject



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

def savekey
  key = Spaux::Chef::RawKey
  if !options[:file]
    puts key
  else
    ::File.write(options[:file], key)
  end
end