Class: Sherpa::CLI::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sherpa/cli/config.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prompt = TTY::Prompt.new) ⇒ Config

Returns a new instance of Config.



6
7
8
# File 'lib/sherpa/cli/config.rb', line 6

def initialize(prompt = TTY::Prompt.new)
  @prompt = prompt
end

Class Method Details

.runObject



10
11
12
# File 'lib/sherpa/cli/config.rb', line 10

def self.run
  new.run
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
# File 'lib/sherpa/cli/config.rb', line 14

def run
  prompt.warn("You haven't setup your Sherpa config yet")
  if setup_config?
    setup_config_file
  else
    Kernel.exit
  end
end