puppet-parse 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/puppet-parse/hash.rb +8 -1
- data/lib/puppet-parse/version.rb +1 -1
- data/spec/puppet-parse_spec.rb +11 -0
- metadata +2 -2
data/lib/puppet-parse/hash.rb
CHANGED
@@ -4,7 +4,14 @@ class Hash
|
|
4
4
|
result = {}
|
5
5
|
|
6
6
|
self.each do |key, val|
|
7
|
-
|
7
|
+
if val.is_a?(Puppet::Parser::AST::ASTArray)
|
8
|
+
result[key] = []
|
9
|
+
val.each do |item|
|
10
|
+
result[key] << item.to_s.gsub("\"",'')
|
11
|
+
end
|
12
|
+
else
|
13
|
+
result[key] = (defined? val.value) ? val.value : nil
|
14
|
+
end
|
8
15
|
end
|
9
16
|
|
10
17
|
result
|
data/lib/puppet-parse/version.rb
CHANGED
data/spec/puppet-parse_spec.rb
CHANGED
@@ -120,3 +120,14 @@ describe "noclass" do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
end
|
123
|
+
|
124
|
+
describe "parameter with array" do
|
125
|
+
file = 'spec/manifests/array_parameters.pp'
|
126
|
+
subject { setup(file) }
|
127
|
+
|
128
|
+
it 'parameters param_one should be an array' do
|
129
|
+
subject['array_parameters']['parameters']['param_one'].should be_a(Array)
|
130
|
+
subject['array_parameters']['parameters']['param_one'].should have(2).items
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-parse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|