Class: Feefi::Cli

Inherits:
Thor
  • Object
show all
Includes:
Helpers, Thor::Actions
Defined in:
lib/feefi/cli.rb

Instance Method Summary collapse

Methods included from Helpers

#app_config, #preamble

Instance Method Details

#appsObject



20
21
22
23
# File 'lib/feefi/cli.rb', line 20

def apps
  Feefi::Helpers.preamble "Your apps"
  puts Feefi::Config.apps.map(&:name)
end

#serversObject



28
29
30
# File 'lib/feefi/cli.rb', line 28

def servers
  s = beanstalk.servers options[:env]
end

#setupObject



15
16
17
# File 'lib/feefi/cli.rb', line 15

def setup
  Feefi::Setup.create_feefi_config
end

#templatesObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/feefi/cli.rb', line 38

def templates
  unless options[:list] || options[:delete]
    puts "No action specified, supply --list or --delete"
    exit
  end
  if options[:list]
    preamble "#{options[:app_name]} | #{options[:env]} Configuration Templates"
    puts beanstalk.list_templates
  elsif options[:delete]
    if yes? "Are you sure you want to delete #{options[:name]}?"
        beanstalk.delete_template options[:name]
    end
  end
end