hiera-json 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ class Hiera
8
8
  end
9
9
 
10
10
  def lookup(key, scope, order_override, resolution_type)
11
- answer = Backend.empty_answer(resolution_type)
11
+ answer = nil
12
12
 
13
13
  Hiera.debug("Looking up #{key} in JSON backend")
14
14
 
@@ -27,9 +27,11 @@ class Hiera
27
27
  # the array
28
28
  #
29
29
  # for priority searches we break after the first found data item
30
+ new_answer = Backend.parse_answer(data[key], scope)
30
31
  case resolution_type
31
32
  when :array
32
- answer << Backend.parse_answer(data[key], scope)
33
+ answer ||= []
34
+ answer << new_answer
33
35
  else
34
36
  answer = Backend.parse_answer(data[key], scope)
35
37
  break
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-json
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Puppet Labs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-13 00:00:00 Z
18
+ date: 2012-08-30 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: hiera
@@ -25,12 +25,11 @@ dependencies:
25
25
  requirements:
26
26
  - - ~>
27
27
  - !ruby/object:Gem::Version
28
- hash: 19
28
+ hash: 15
29
29
  segments:
30
+ - 1
30
31
  - 0
31
- - 3
32
- - 0
33
- version: 0.3.0
32
+ version: "1.0"
34
33
  type: :runtime
35
34
  version_requirements: *id001
36
35
  - !ruby/object:Gem::Dependency
@@ -87,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
86
  requirements: []
88
87
 
89
88
  rubyforge_project:
90
- rubygems_version: 1.8.10
89
+ rubygems_version: 1.8.24
91
90
  signing_key:
92
91
  specification_version: 3
93
92
  summary: JSON backend for the Hiera hierarcical data store