stack_master 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26523ee5aa16ba21756d486d7619b09c2fa2ee77
4
- data.tar.gz: 56830d0b945a777db396799c98066742d2c1e4bd
3
+ metadata.gz: 0290ee1dd10780abd86abcd6818ff3e4ad913380
4
+ data.tar.gz: 57dd36502a7e98b1940336f9f3a8aa3364a2a6bd
5
5
  SHA512:
6
- metadata.gz: eff6fcc6ca243f1149db52968c0effc3e963cb161ed4a88863fc420932bd3c3297c895d964fe3acd1a0d0c036ba64ece99f2c8d6093e4d9dc24f951276d9d427
7
- data.tar.gz: 9623fa5996449668f58d9c1f34b3774b5469d6332ba56c011773264654b0e8e91e50a9590ef02c0a1030f90b8b29db025096fa515dd358f33a95d4e445415289
6
+ metadata.gz: c2e1bec9d3deefa251ba550f75fb7c43013efedafd0c5e37ccccc3eb65c2d26e367b6386ad370d3b4bea584c5fef1ac04306e15ea901c4595883c0502b10b943
7
+ data.tar.gz: c4f02a55dbd4ed0b82747ff3172ba023f99aff8445dcfd085eb91d6498ce9b491e6b41ef6cc05266a4d0ecc5ac7e07e8b757453d13199243997bc94de556242f
@@ -43,6 +43,7 @@ module StackMaster
43
43
 
44
44
  def resolve_parameter_value(key, parameter_value)
45
45
  return parameter_value.to_s if Numeric === parameter_value
46
+ return parameter_value.join(',') if Array === parameter_value
46
47
  return parameter_value unless Hash === parameter_value
47
48
  validate_parameter_value!(key, parameter_value)
48
49
 
@@ -7,9 +7,9 @@ module StackMaster
7
7
  end
8
8
 
9
9
  def resolve(values)
10
- value_list = Array(values).map do |value|
10
+ Array(values).map do |value|
11
11
  resolver_class.new(@config, @stack_definition).resolve(value)
12
- end
12
+ end.join(',')
13
13
  end
14
14
 
15
15
  def resolver_class
@@ -1,3 +1,3 @@
1
1
  module StackMaster
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -34,6 +34,10 @@ RSpec.describe StackMaster::ParameterResolver do
34
34
  expect(resolve(param1: 2)).to eq(param1: '2')
35
35
  end
36
36
 
37
+ it 'joins arrays into comma separated strings' do
38
+ expect(resolve(param1: [1, 2])).to eq(param1: '1,2')
39
+ end
40
+
37
41
  it 'it throws an error when the hash contains more than one key' do
38
42
  expect {
39
43
  resolve(param: { nested1: 'value1', nested2: 'value2' })
@@ -12,7 +12,7 @@ RSpec.describe StackMaster::ParameterResolvers::SecurityGroups do
12
12
 
13
13
  context 'when given a single SG name' do
14
14
  it "resolves the security group" do
15
- expect(resolver.resolve(sg_name)).to eq [sg_id]
15
+ expect(resolver.resolve(sg_name)).to eq sg_id
16
16
  end
17
17
  end
18
18
 
@@ -25,7 +25,7 @@ RSpec.describe StackMaster::ParameterResolvers::SecurityGroups do
25
25
  end
26
26
 
27
27
  it "resolves the security groups" do
28
- expect(resolver.resolve([sg_name, sg_name2])).to eq [sg_id, sg_id2]
28
+ expect(resolver.resolve([sg_name, sg_name2])).to eq "#{sg_id},#{sg_id2}"
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodgkiss
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-09 00:00:00.000000000 Z
12
+ date: 2016-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler