roadworker 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,7 +66,7 @@ module Roadworker
66
66
  end
67
67
 
68
68
  def resource_record_sets
69
- ResourceRecordSetCollectionWrapper.new(@hosted_zone.rrsets, @options)
69
+ ResourceRecordSetCollectionWrapper.new(@hosted_zone.rrsets, @hosted_zone, @options)
70
70
  end
71
71
  alias rrsets resource_record_sets
72
72
 
@@ -97,14 +97,15 @@ module Roadworker
97
97
  class ResourceRecordSetCollectionWrapper
98
98
  include Roadworker::Log
99
99
 
100
- def initialize(resource_record_sets, options)
100
+ def initialize(resource_record_sets, hosted_zone, options)
101
101
  @resource_record_sets = resource_record_sets
102
+ @hosted_zone = hosted_zone
102
103
  @options = options
103
104
  end
104
105
 
105
106
  def each
106
107
  Collection.batch(@resource_record_sets) do |record|
107
- yield(ResourceRecordSetWrapper.new(record, @options))
108
+ yield(ResourceRecordSetWrapper.new(record, @hosted_zone, @options))
108
109
  end
109
110
  end
110
111
 
@@ -137,15 +138,16 @@ module Roadworker
137
138
  @options.updated = true
138
139
  end
139
140
 
140
- ResourceRecordSetWrapper.new(record, @options)
141
+ ResourceRecordSetWrapper.new(record, @hosted_zone, @options)
141
142
  end
142
143
  end # ResourceRecordSetCollectionWrapper
143
144
 
144
145
  class ResourceRecordSetWrapper
145
146
  include Roadworker::Log
146
147
 
147
- def initialize(resource_record_set, options)
148
+ def initialize(resource_record_set, hosted_zone, options)
148
149
  @resource_record_set = resource_record_set
150
+ @hosted_zone = hosted_zone
149
151
  @options = options
150
152
  end
151
153
 
@@ -205,7 +207,9 @@ module Roadworker
205
207
  end
206
208
 
207
209
  def delete
208
- return if type =~ /\A(SOA|NS)\Z/i
210
+ if @resource_record_set.name == @hosted_zone.name and type =~ /\A(SOA|NS)\Z/i
211
+ return
212
+ end
209
213
 
210
214
  log(:info, 'Delete ResourceRecordSet', :red) do
211
215
  log_id = [self.name, self.type].join(' ')
@@ -1,5 +1,5 @@
1
1
  module Roadworker
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
4
4
 
5
5
  Version = Roadworker::VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadworker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.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: 2013-07-30 00:00:00.000000000 Z
12
+ date: 2013-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk