roadworker 0.2.4 → 0.2.5

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.
data/README.md CHANGED
@@ -76,3 +76,10 @@ info.winebarrel.jp. A:
76
76
  actual=127.0.0.1(300),127.0.0.2(300)
77
77
  5 examples, 1 failure
78
78
  ```
79
+ ## CI
80
+ [drone.io](https://drone.io/bitbucket.org/winebarrel/roadworker)
81
+
82
+ [![Build Status](https://drone.io/bitbucket.org/winebarrel/roadworker/status.png)](https://drone.io/bitbucket.org/winebarrel/roadworker/latest)
83
+
84
+ ## Link
85
+ * [RubyGems.org site](http://rubygems.org/gems/roadworker)
@@ -111,7 +111,7 @@ module Roadworker
111
111
  collection.each do |item|
112
112
  key_list = keys.map do |k|
113
113
  value = item.send(k)
114
- (k == :name && value) ? value.downcase.gsub(/\.\Z/, '') : value
114
+ (k == :name && value) ? value.downcase.sub(/\.\Z/, '') : value
115
115
  end
116
116
 
117
117
  hash[key_list] = item
@@ -68,7 +68,7 @@ module Roadworker
68
68
  private
69
69
 
70
70
  def resource_record_set(rrset_name, type, &block)
71
- if rrset_name.gsub(/\.\Z/, '') !~ /#{Regexp.escape(@name.gsub(/\.\Z/, ''))}\Z/i
71
+ if rrset_name.sub(/\.\Z/, '') !~ /#{Regexp.escape(@name.sub(/\.\Z/, ''))}\Z/i
72
72
  raise "Invalid ResourceRecordSet Name: #{rrset_name}"
73
73
  end
74
74
 
@@ -4,7 +4,7 @@ module AWS
4
4
  class Route53
5
5
 
6
6
  def dns_name_to_alias_target(name)
7
- name = name.gsub(/\.\Z/, '')
7
+ name = name.sub(/\.\Z/, '')
8
8
 
9
9
  unless name =~ /([^.]+)\.elb\.amazonaws.com\Z/i
10
10
  raise "Invalid DNS Name: #{name}"
@@ -50,6 +50,7 @@ module Roadworker
50
50
  zone = OpenStruct.new({:name => name, :rrsets => []}.merge(opts))
51
51
  else
52
52
  zone = @hosted_zones.create(name, opts)
53
+ @options.hosted_zone_name = name
53
54
  @options.updated = true
54
55
  end
55
56
 
@@ -163,8 +164,8 @@ module Roadworker
163
164
  elsif expected and actual
164
165
  case attr
165
166
  when :dns_name
166
- expected = expected.downcase.gsub(/\.\Z/, '')
167
- actual = actual.downcase.gsub(/\.\Z/, '')
167
+ expected = expected.downcase.sub(/\.\Z/, '')
168
+ actual = actual.downcase.sub(/\.\Z/, '')
168
169
  end
169
170
 
170
171
  (expected == actual)
@@ -207,8 +208,10 @@ module Roadworker
207
208
  end
208
209
 
209
210
  def delete
210
- if @resource_record_set.name == @hosted_zone.name and type =~ /\A(SOA|NS)\Z/i
211
- return
211
+ if self.type =~ /\A(SOA|NS)\Z/i
212
+ hz_name = (@hosted_zone.name || @options.hosted_zone_name).downcase.sub(/\.\Z/, '')
213
+ rrs_name = @resource_record_set.name.downcase.sub(/\.\Z/, '')
214
+ return if hz_name == rrs_name
212
215
  end
213
216
 
214
217
  log(:info, 'Delete ResourceRecordSet', :red) do
@@ -1,5 +1,5 @@
1
1
  module Roadworker
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
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.4
4
+ version: 0.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: