hiera 1.2.0.rc2 → 1.2.0.rc3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of hiera might be problematic. Click here for more details.

data/lib/hiera.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'yaml'
2
2
 
3
3
  class Hiera
4
- VERSION = "1.2.0-rc2"
4
+ VERSION = "1.2.0-rc3"
5
5
 
6
6
  require "hiera/config"
7
7
  require "hiera/util"
data/lib/hiera/config.rb CHANGED
@@ -42,10 +42,25 @@ class Hiera::Config
42
42
  @config[:logger] = "console"
43
43
  Hiera.logger = "console"
44
44
  end
45
+
46
+ self.validate!
45
47
 
46
48
  @config
47
49
  end
48
50
 
51
+ def validate!
52
+ case @config[:merge_behavior]
53
+ when :deep,'deep',:deeper,'deeper'
54
+ begin
55
+ require "deep_merge"
56
+ rescue LoadError
57
+ Hiera.warn "Ignoring configured merge_behavior"
58
+ Hiera.warn "Must have 'deep_merge' gem installed."
59
+ @config[:merge_behavior] = :native
60
+ end
61
+ end
62
+ end
63
+
49
64
  ##
50
65
  # yaml_load_file directly delegates to YAML.load_file and is intended to be
51
66
  # a private, internal method suitable for stubbing and mocking.
@@ -390,6 +390,7 @@ class Hiera
390
390
  before do
391
391
  Hiera.stubs(:debug)
392
392
  Hiera.stubs(:warn)
393
+ Config.stubs(:validate!)
393
394
  end
394
395
 
395
396
  it "uses Hash.merge when configured with :merge_behavior => :native" do
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera
3
3
  version: !ruby/object:Gem::Version
4
- hash: -723940848
4
+ hash: -3093716430
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
9
  - 0
10
10
  - rc
11
- - 2
12
- version: 1.2.0.rc2
11
+ - 3
12
+ version: 1.2.0.rc3
13
13
  platform: ruby
14
14
  authors:
15
15
  - Puppet Labs
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2013-03-12 00:00:00 Z
20
+ date: 2013-03-27 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: json_pure