dynamic_configuration 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dynamic_configuration}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Jarosław Rzeszótko}]
@@ -72,7 +72,7 @@ module DynamicConfiguration
72
72
  def finalize_config
73
73
  @config.freeze
74
74
 
75
- if Object.instance_eval { const_defined?(:Rails) }
75
+ if @rails_loaded
76
76
  ::ActiveSupport::Dependencies.autoload_paths << @config_path.to_s
77
77
  ::ActiveSupport::Dependencies.explicitly_unloadable_constants << @const_name.to_s
78
78
  end
@@ -15,10 +15,26 @@ describe DynamicConfiguration do
15
15
  end
16
16
 
17
17
  it "should make per-environment settings take precedence over main configuration" do
18
- Rails = mock(:env => 'test').as_null_object
19
- DynamicConfiguration::create(:Settings, path)
20
- Settings.main.setting_three.should == [3, 2, 1]
21
- Object.instance_eval { remove_const :Rails }
18
+ begin
19
+ Rails = mock(:env => 'test').as_null_object
20
+
21
+ module ::ActiveSupport
22
+ module Dependencies
23
+ class << self
24
+ def autoload_paths; []; end
25
+ def explicitly_unloadable_constants; []; end
26
+ end
27
+ end
28
+ end
29
+
30
+ DynamicConfiguration::create(:Settings, path)
31
+ Settings.main.setting_three.should == [3, 2, 1]
32
+ ensure
33
+ Object.instance_eval do
34
+ remove_const :Rails
35
+ remove_const :ActiveSupport
36
+ end
37
+ end
22
38
  end
23
39
 
24
40
  it "should make local settings take precedence even over per-environment settings" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_configuration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
16
- requirement: &75144200 !ruby/object:Gem::Requirement
16
+ requirement: &75603140 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *75144200
24
+ version_requirements: *75603140
25
25
  description: Flexible configuration library for Ruby and Rails applications.
26
26
  email: jrzeszotko@gmail.com
27
27
  executables: []