Class: Billy::Commands::Config

Inherits:
Command
  • Object
show all
Defined in:
lib/billy/commands/config.rb

Instance Method Summary collapse

Methods inherited from Command

instance, #name, register_self!

Instance Method Details

#proceed!(arguments = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/billy/commands/config.rb', line 9

def proceed!( arguments = nil )
  %w(. ~).each do |f|
    dir = File.expand_path( f )
    next unless Billy::Config.config_exists?( dir )
    Billy::Util::UI.inform "Config loaded from file: #{dir}/#{Billy::Config::BILLYRC}"
    Billy::Config.load!( dir )
    Billy::Util::UI.inform "Current Billy settings:"
    Billy::Config.settings.each_pair do |k, v|
      yellow_k = "#{k}".magenta
      Billy::Util::UI.inform "#{yellow_k}:\t\t#{v.green}"
    end
    return
  end
  
  Billy::Util::UI.err "Billy config file could not be found here. Say Billy hello."
  exit 1
  
end