Module: Blue::Config

Included in:
Blue
Defined in:
lib/blue/config.rb

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/blue/config.rb', line 4

def self.included(klass)
  klass.class_eval do
    @@config = Hashie::Mash.new

    def self.configure(new_config = {})
      @@config.deep_merge!(new_config)
    end

    def self.load_app_config!
      configure(YAML.load(IO.read(BLUE_CONFIG)))
    end

    def self.config
      @@config
    end

    Blue.configure({
      :user  => 'rails',
      :group => 'rails',
      :scm   => 'git',
      :prod_safe_ip_addresses => []
    })
  end
end