Class: Cloudspin::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/cloudspin/cli.rb', line 95

def self.exit_on_failure?
  true
end

Instance Method Details

#down(id) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/cloudspin/cli.rb', line 51

def down(id)
  if options[:plan] && options[:dry]
    puts instance(id).plan_dry(plan_destroy: true)
  elsif options[:plan] && ! options[:dry]
    puts instance(id).plan(plan_destroy: true)
  elsif ! options[:plan] && options[:dry]
    puts instance(id).down_dry
  else
    instance(id).down
  end
end

#infoObject



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

def info
  puts "Configuration file: #{options[:file]}"
end

#up(id) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/cloudspin/cli.rb', line 36

def up(id)
  if options[:plan] && options[:dry]
    puts instance(id).plan_dry
  elsif options[:plan] && ! options[:dry]
    puts instance(id).plan
  elsif ! options[:plan] && options[:dry]
    puts instance(id).up_dry
  else
    instance(id).up
  end
end

#versionObject



64
65
66
# File 'lib/cloudspin/cli.rb', line 64

def version
  puts "cloudspin-stack: #{Cloudspin::Stack::VERSION}"
end