roadworker 0.4.0 → 0.4.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: efa1def64b9857b4163dec7834451bd043691b02
4
- data.tar.gz: 22896a3d8aec83cbe1e8cd35902a19bae813a9ff
3
+ metadata.gz: a0d3f642ddf0b9f28e2c6607a14c70f71a05d6e3
4
+ data.tar.gz: 2068acde30d38e452d3a3840f7d136ce0d5b4ae0
5
5
  SHA512:
6
- metadata.gz: 0ff0d8d411d8946dcf5d6c603176fec39ce612ad9ff0b32ef5d197735c9e697d6d5f7c1bb20c26dbacec5fa498145a44877fc015cd61711df2d11d3772149ce3
7
- data.tar.gz: 58a926b9dd085d59a817cd0a4b8a72fe922daddee9f1b1199f3b00f63598eece18d88dcc2b4d006d249c58ef7c85d08e5e422d4c1b01ffd3ff039577a007402f
6
+ metadata.gz: 9a6142c0e48b09eb6ac983ad9abb34e157c2dcd7c8518d49c44b196f7d909c2cd0340115e36060631507db12e85c02bea8bf1a9e65dcc1d34f3780f801241f79
7
+ data.tar.gz: 3dc7c2db81defc7750e085c44f2b35db93d24bf4bb8c3315bf46f8ae511fc3f0187a4a688f1cb7cb90e8b9447ff5d7855e0e860dedd805961e340433c09dcb2e
@@ -92,7 +92,7 @@ module Roadworker
92
92
  actual_value = actual_value.map {|i| i.downcase.sub(/\.\Z/, '') }
93
93
  when 'TXT', 'SPF'
94
94
  # see https://github.com/bluemonk/net-dns/blob/651dc1006d9ee0c167fa515e4b9d2494af415ae9/lib/net/dns/rr/txt.rb#L46
95
- expected_value = expected_value.map {|i| i.scan(/"([^"]+)"/).join(' ').strip }
95
+ expected_value = expected_value.map {|i| i.scan(/(?:\\\\|(?:\\"|(?:[^\\"]|[^"])))*"((?:\\\\|(?:\\"|(?:\\"|(?:[^\\"]|[^"]))))*)"/).join(' ').gsub(/\\(.)/) { $1 }.strip }
96
96
  actual_value = actual_value.map {|i| i.strip }
97
97
  end
98
98
 
@@ -72,9 +72,9 @@ module Roadworker
72
72
  def item_to_hash(item, *attrs)
73
73
  h = {}
74
74
 
75
- attrs.each do |attr|
76
- value = item.send(attr)
77
- h[attr] = value if value
75
+ attrs.each do |attribute|
76
+ value = item.send(attribute)
77
+ h[attribute] = value if value
78
78
  end
79
79
 
80
80
  return h
@@ -126,20 +126,20 @@ module Roadworker
126
126
  else
127
127
  opts = {}
128
128
 
129
- Route53Wrapper::RRSET_ATTRS.each do |attr|
130
- value = expected_record.send(attr)
129
+ Route53Wrapper::RRSET_ATTRS.each do |attribute|
130
+ value = expected_record.send(attribute)
131
131
  next unless value
132
132
 
133
- case attr
133
+ case attribute
134
134
  when :dns_name
135
- attr = :alias_target
135
+ attribute = :alias_target
136
136
  value = AWS::Route53.dns_name_to_alias_target(value, @hosted_zone.id, @hosted_zone.name || @options.hosted_zone_name)
137
137
  when :health_check
138
- attr = :health_check_id
138
+ attribute = :health_check_id
139
139
  value = @options.health_checks.find_or_create(value)
140
140
  end
141
141
 
142
- opts[attr] = value
142
+ opts[attribute] = value
143
143
  end
144
144
 
145
145
  record = @resource_record_sets.create(name, type, opts)
@@ -160,16 +160,16 @@ module Roadworker
160
160
  end
161
161
 
162
162
  def eql?(expected_record)
163
- Route53Wrapper::RRSET_ATTRS_WITH_TYPE.all? do |attr|
164
- expected = expected_record.send(attr)
163
+ Route53Wrapper::RRSET_ATTRS_WITH_TYPE.all? do |attribute|
164
+ expected = expected_record.send(attribute)
165
165
  expected = nil if expected.kind_of?(Array) && expected.empty?
166
- actual = self.send(attr)
166
+ actual = self.send(attribute)
167
167
  actual = nil if actual.kind_of?(Array) && actual.empty?
168
168
 
169
169
  if !expected and !actual
170
170
  true
171
171
  elsif expected and actual
172
- case attr
172
+ case attribute
173
173
  when :dns_name
174
174
  expected = expected.downcase.sub(/\.\Z/, '')
175
175
  actual = actual.downcase.sub(/\.\Z/, '')
@@ -191,19 +191,19 @@ module Roadworker
191
191
 
192
192
  log(:info, 'Update ResourceRecordSet', :green, &log_id_proc)
193
193
 
194
- Route53Wrapper::RRSET_ATTRS_WITH_TYPE.each do |attr|
195
- expected = expected_record.send(attr)
194
+ Route53Wrapper::RRSET_ATTRS_WITH_TYPE.each do |attribute|
195
+ expected = expected_record.send(attribute)
196
196
  expected = nil if expected.kind_of?(Array) && expected.empty?
197
- actual = self.send(attr)
197
+ actual = self.send(attribute)
198
198
  actual = nil if actual.kind_of?(Array) && actual.empty?
199
199
 
200
200
  if (expected and !actual) or (!expected and actual)
201
- log(:info, " set #{attr}=#{expected.inspect}" , :green)
202
- self.send(:"#{attr}=", expected) unless @options.dry_run
201
+ log(:info, " set #{attribute}=#{expected.inspect}" , :green)
202
+ self.send(:"#{attribute}=", expected) unless @options.dry_run
203
203
  elsif expected and actual
204
204
  if expected != actual
205
- log(:info, " set #{attr}=#{expected.inspect}" , :green)
206
- self.send(:"#{attr}=", expected) unless @options.dry_run
205
+ log(:info, " set #{attribute}=#{expected.inspect}" , :green)
206
+ self.send(:"#{attribute}=", expected) unless @options.dry_run
207
207
  end
208
208
  end
209
209
  end
@@ -1,5 +1,5 @@
1
1
  module Roadworker
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
4
4
 
5
5
  Version = Roadworker::VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-01 00:00:00.000000000 Z
11
+ date: 2014-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk