waffle 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/waffle/config.rb CHANGED
@@ -10,15 +10,22 @@ module Waffle
10
10
  def initialize
11
11
  @config_hash = {'transport' => 'rabbitmq', 'url' => nil, 'encoder' => 'json'}
12
12
 
13
+ filename = "config/waffle.yml"
14
+
13
15
  if defined? Rails
14
- if File.exists? "#{Rails.root}/config/waffle.yml"
15
- loaded_config = YAML.load_file("#{Rails.root}/config/waffle.yml")
16
+ fielname = "#{Rails.root}/config/waffle.yml"
17
+ end
18
+
19
+ if File.exists?(filename)
20
+ loaded_config = YAML.load_file filename
16
21
 
17
- if loaded_config[Rails.env]
18
- @config_hash.merge! loaded_config[Rails.env]
19
- end
22
+ if defined?(Rails) && loaded_config[Rails.env]
23
+ @config_hash.merge! loaded_config[Rails.env]
24
+ else
25
+ @config_hash.merge! loaded_config
20
26
  end
21
27
  end
28
+
22
29
  end
23
30
 
24
31
  class << self
@@ -1,5 +1,5 @@
1
1
  module Waffle
2
2
 
3
- VERSION = '0.3.4'
3
+ VERSION = '0.3.5'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waffle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-05 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bunny
16
- requirement: &76785160 !ruby/object:Gem::Requirement
16
+ requirement: &75330640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *76785160
24
+ version_requirements: *75330640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: yajl-ruby
27
- requirement: &76783560 !ruby/object:Gem::Requirement
27
+ requirement: &75330060 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *76783560
35
+ version_requirements: *75330060
36
36
  description: Client part of Patty statistics server
37
37
  email: alexander.lomakin@gmail.com
38
38
  executables: []