Class: Whisk::CLI

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

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



25
26
27
28
29
30
31
32
# File 'lib/whisk/cli.rb', line 25

def initialize(*)
  super
  ::Whisk.ui = Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
  @options = options.dup # unfreeze frozen options Hash from Thor
rescue Error => e
  Whisk.ui.fatal e
  exit e.status_code
end

Instance Method Details

#destroy(filter = nil) ⇒ Object



44
45
46
47
# File 'lib/whisk/cli.rb', line 44

def destroy(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('destroy')
end

#diff(filter = nil) ⇒ Object



50
51
52
53
# File 'lib/whisk/cli.rb', line 50

def diff(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('diff')
end

#list(filter = nil) ⇒ Object



56
57
58
59
# File 'lib/whisk/cli.rb', line 56

def list(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('list')
end

#prepare(filter = nil) ⇒ Object



62
63
64
65
# File 'lib/whisk/cli.rb', line 62

def prepare(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('prepare')
end

#status(filter = nil) ⇒ Object



68
69
70
71
# File 'lib/whisk/cli.rb', line 68

def status(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('status')
end

#update(filter = nil) ⇒ Object



74
75
76
77
# File 'lib/whisk/cli.rb', line 74

def update(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('update')
end

#upload(filter = nil) ⇒ Object



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

def upload(filter=nil)
  runner = Whisk::Runner.new(options[:whiskfile], filter)
  runner.run('upload')
end