cloudformation-ruby-dsl 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,7 @@ require 'highline/import'
34
34
  class AwsCfn
35
35
  attr_accessor :cfn_client_instance
36
36
 
37
- def initialize(**args)
37
+ def initialize(args)
38
38
  Aws.config[:region] = args[:region] if args.key?(:region)
39
39
  end
40
40
 
@@ -44,7 +44,7 @@ class AwsCfn
44
44
  @cfn_client_instance = Aws::CloudFormation::Client.new(
45
45
  # we don't validate parameters because the aws-ruby-sdk gets a number parameter and expects it to be a string and fails the validation
46
46
  # see: https://github.com/aws/aws-sdk-ruby/issues/848
47
- validate_params: false,
47
+ validate_params: false
48
48
  )
49
49
  end
50
50
  @cfn_client_instance
@@ -132,7 +132,7 @@ def validate_action(action)
132
132
  end
133
133
 
134
134
  def cfn(template)
135
- aws_cfn = AwsCfn.new(region: template.aws_region)
135
+ aws_cfn = AwsCfn.new({:region => template.aws_region})
136
136
  cfn_client = aws_cfn.cfn_client
137
137
 
138
138
  action = validate_action( ARGV[0] )
@@ -207,8 +207,8 @@ def cfn(template)
207
207
  old_parameters = old_attributes.parameters
208
208
 
209
209
  # Sort the tag strings alphabetically to make them easily comparable
210
- old_tags_string = old_tags.sort.map { |tag| %Q(TAG "#{tag.key}=#{tag.value}"\n) }.join
211
- tags_string = cfn_tags.sort.map { |tag| "TAG \"#{tag}\"\n" }.join
210
+ old_tags_string = old_tags.map { |tag| %Q(TAG "#{tag.key}=#{tag.value}"\n) }.sort.join
211
+ tags_string = cfn_tags.map { |k, v| %Q(TAG "#{k.to_s}=#{v}"\n) }.sort.join
212
212
 
213
213
  # Sort the parameter strings alphabetically to make them easily comparable
214
214
  old_parameters_string = old_parameters.sort! {|pCurrent, pNext| pCurrent.parameter_key <=> pNext.parameter_key }.map { |param| %Q(PARAMETER "#{param.parameter_key}=#{param.parameter_value}"\n) }.join
@@ -398,9 +398,9 @@ def cfn(template)
398
398
 
399
399
  # Tags are immutable in CloudFormation. Validate against the existing stack to ensure tags haven't changed.
400
400
  # Compare the sorted arrays for an exact match
401
- old_cfn_tags = old_stack.tags.map { |p| [p.key.to_sym, p.value]}
402
- cfn_tags_ary = cfn_tags.to_a
403
- if cfn_tags_ary.sort != old_cfn_tags
401
+ old_cfn_tags = old_stack.tags.map { |p| [p.key.to_sym, p.value]}.sort
402
+ cfn_tags_ary = cfn_tags.to_a.sort
403
+ if cfn_tags_ary != old_cfn_tags
404
404
  $stderr.puts "CloudFormation stack tags do not match and cannot be updated. You must either use the same tags or create a new stack." +
405
405
  "\n" + (old_cfn_tags - cfn_tags_ary).map {|tag| "< #{tag}" }.join("\n") +
406
406
  "\n" + "---" +
@@ -151,7 +151,6 @@ def get_azs(region = '') { :'Fn::GetAZs' => region } end
151
151
  def join(delim, *list)
152
152
  case list.length
153
153
  when 0 then ''
154
- when 1 then list[0]
155
154
  else join_list(delim,list)
156
155
  end
157
156
  end
@@ -15,7 +15,7 @@
15
15
  module Cfn
16
16
  module Ruby
17
17
  module Dsl
18
- VERSION = "1.0.3"
18
+ VERSION = "1.0.4"
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-ruby-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Shawn Smith
@@ -15,90 +16,102 @@ authors:
15
16
  autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
- date: 2015-07-14 00:00:00.000000000 Z
19
+ date: 2015-09-09 00:00:00.000000000 Z
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: detabulator
22
23
  requirement: !ruby/object:Gem::Requirement
24
+ none: false
23
25
  requirements:
24
- - - '>='
26
+ - - ! '>='
25
27
  - !ruby/object:Gem::Version
26
28
  version: '0'
27
29
  type: :runtime
28
30
  prerelease: false
29
31
  version_requirements: !ruby/object:Gem::Requirement
32
+ none: false
30
33
  requirements:
31
- - - '>='
34
+ - - ! '>='
32
35
  - !ruby/object:Gem::Version
33
36
  version: '0'
34
37
  - !ruby/object:Gem::Dependency
35
38
  name: json
36
39
  requirement: !ruby/object:Gem::Requirement
40
+ none: false
37
41
  requirements:
38
- - - '>='
42
+ - - ! '>='
39
43
  - !ruby/object:Gem::Version
40
44
  version: '0'
41
45
  type: :runtime
42
46
  prerelease: false
43
47
  version_requirements: !ruby/object:Gem::Requirement
48
+ none: false
44
49
  requirements:
45
- - - '>='
50
+ - - ! '>='
46
51
  - !ruby/object:Gem::Version
47
52
  version: '0'
48
53
  - !ruby/object:Gem::Dependency
49
54
  name: bundler
50
55
  requirement: !ruby/object:Gem::Requirement
56
+ none: false
51
57
  requirements:
52
- - - '>='
58
+ - - ! '>='
53
59
  - !ruby/object:Gem::Version
54
60
  version: '0'
55
61
  type: :runtime
56
62
  prerelease: false
57
63
  version_requirements: !ruby/object:Gem::Requirement
64
+ none: false
58
65
  requirements:
59
- - - '>='
66
+ - - ! '>='
60
67
  - !ruby/object:Gem::Version
61
68
  version: '0'
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: aws-sdk
64
71
  requirement: !ruby/object:Gem::Requirement
72
+ none: false
65
73
  requirements:
66
- - - '>='
74
+ - - ! '>='
67
75
  - !ruby/object:Gem::Version
68
76
  version: '0'
69
77
  type: :runtime
70
78
  prerelease: false
71
79
  version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
72
81
  requirements:
73
- - - '>='
82
+ - - ! '>='
74
83
  - !ruby/object:Gem::Version
75
84
  version: '0'
76
85
  - !ruby/object:Gem::Dependency
77
86
  name: diffy
78
87
  requirement: !ruby/object:Gem::Requirement
88
+ none: false
79
89
  requirements:
80
- - - '>='
90
+ - - ! '>='
81
91
  - !ruby/object:Gem::Version
82
92
  version: '0'
83
93
  type: :runtime
84
94
  prerelease: false
85
95
  version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
86
97
  requirements:
87
- - - '>='
98
+ - - ! '>='
88
99
  - !ruby/object:Gem::Version
89
100
  version: '0'
90
101
  - !ruby/object:Gem::Dependency
91
102
  name: highline
92
103
  requirement: !ruby/object:Gem::Requirement
104
+ none: false
93
105
  requirements:
94
- - - '>='
106
+ - - ! '>='
95
107
  - !ruby/object:Gem::Version
96
108
  version: '0'
97
109
  type: :runtime
98
110
  prerelease: false
99
111
  version_requirements: !ruby/object:Gem::Requirement
112
+ none: false
100
113
  requirements:
101
- - - '>='
114
+ - - ! '>='
102
115
  - !ruby/object:Gem::Version
103
116
  version: '0'
104
117
  description: Ruby DSL library that provides a wrapper around the CloudFormation.
@@ -144,27 +157,28 @@ files:
144
157
  - lib/cloudformation-ruby-dsl/version.rb
145
158
  homepage: http://github.com/bazaarvoice/cloudformation-ruby-dsl
146
159
  licenses: []
147
- metadata: {}
148
160
  post_install_message:
149
161
  rdoc_options: []
150
162
  require_paths:
151
163
  - lib
152
164
  - bin
153
165
  required_ruby_version: !ruby/object:Gem::Requirement
166
+ none: false
154
167
  requirements:
155
- - - '>='
168
+ - - ! '>='
156
169
  - !ruby/object:Gem::Version
157
170
  version: '0'
158
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
+ none: false
159
173
  requirements:
160
- - - '>='
174
+ - - ! '>='
161
175
  - !ruby/object:Gem::Version
162
176
  version: '0'
163
177
  requirements: []
164
178
  rubyforge_project:
165
- rubygems_version: 2.0.14
179
+ rubygems_version: 1.8.23.2
166
180
  signing_key:
167
- specification_version: 4
181
+ specification_version: 3
168
182
  summary: Ruby DSL library that provides a wrapper around the CloudFormation. Written
169
183
  by [Bazaarvoice](http://www.bazaarvoice.com).
170
184
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a11f29dffaf1e90a64925175605665a5e4df4941
4
- data.tar.gz: 88c50e0aa3172bdf01b200db843c1925848317fa
5
- SHA512:
6
- metadata.gz: fcf34d371bccdb4164ff7483f618464ce15f755ca11178e26f52ec191147718dc8efd1daea2e87d760353811290f2fa74fd104a8f1a90a4da459185431f7ee87
7
- data.tar.gz: 35b55ccd50f0bdee6b52422606c1ad0c167bc8c2afa9e725d914a7fede723ae0f49621fefa3197f75351335a2fab22206e914397a4f9c2e4888545107a59d06c