Class: Campfire::Config

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

Class Method Summary collapse

Class Method Details

.configObject



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

def self.config
  @config ||= {}
end

.config_value(value) ⇒ Object



24
25
26
27
# File 'lib/campfire.rb', line 24

def self.config_value(value)
  value = value.to_s
  config[value] || ENV[value]
end

.load_configObject



29
30
31
32
33
34
# File 'lib/campfire.rb', line 29

def self.load_config
  IO.foreach(File.join(Dir.home, '.campfirerc')) do |conf|
    k,v = conf.split("=")
    config[k.strip]=v.strip
  end rescue Errno::ENOENT
end