Class: Cheflow::Cli

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

Constant Summary collapse

LATEST =
"latest".freeze

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cli

Returns a new instance of Cli.



14
15
16
17
18
19
# File 'lib/cheflow/cli.rb', line 14

def initialize(*args)
  super(*args)

  Ridley.logger.level = ::Logger::INFO if @options[:verbose]
  Ridley.logger.level = ::Logger::DEBUG if @options[:debug]
end

Instance Method Details

#defaultObject



82
83
84
85
86
87
88
89
90
# File 'lib/cheflow/cli.rb', line 82

def default
  invoke :version
  say
  say '-' * 90
  invoke :info
  say '-' * 90
  say
  invoke :help
end

#infoObject



70
71
72
73
74
75
76
77
78
79
# File 'lib/cheflow/cli.rb', line 70

def info
  say "#{cookbook.type} Cookbook: #{cookbook}"
  say cookbook.path
  say
  say "Environments: #{cookbook.node_environments.join("\n              ")}"
  say
  say 'Versions:'
  say "  Production:  " + cookbook.prod_versions.join(', ')
  say "  Development: " + cookbook.dev_versions.join(', ')
end

#versionObject



65
66
67
# File 'lib/cheflow/cli.rb', line 65

def version
  say "Cheflow v#{Cheflow::VERSION}"
end