Class: Elevage::CLI

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

Overview

Start of main CLI

Instance Method Summary collapse

Instance Method Details

#list(item) ⇒ Object

rubocop:disable LineLength



27
28
29
30
31
32
33
34
35
36
# File 'lib/elevage.rb', line 27

def list(item)
  # errors handled in class methods
  if LIST_CMDS.include?(item)
    puts Elevage::Platform.new.send(item).to_yaml
  else
    fail(IOError, ERR[:not_list_cmd]) unless File.file?(ENV_FOLDER + item + '.yml')
    environment = Elevage::Environment.new(item)
    puts options[:nodes] ? environment.list_nodes : environment
  end
end

#versionObject



20
21
22
# File 'lib/elevage.rb', line 20

def version
  puts VERSION
end