dns-zone 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmY5NGU3NjIwYmU4ZDg1NjcyNGZkOTgwYjQ4ZGVmZmE5MjIzOTZiZQ==
4
+ YmIzYWNlOTU4Y2E0OWY1MDczODZmNjc3ZjBlNTdlY2QzOTdjYmQ2OA==
5
5
  data.tar.gz: !binary |-
6
- OTVkNzhjM2MyZjIzOWMzNTBmZjFhNjBiOTNjOTZiNjY3YmY0NzIzMA==
6
+ MzNkMzQyNTZhZGJkMWQ1MzVhNmNlZjc1MmI5M2I4N2ZmZjNkNWEwNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWFhZDY4OTc3YzYwM2E0OWUwZTIwY2E2YjRlYjM3MTEwZWRlNjljZmEzZGE1
10
- YmQ2YzhjYWQyYTg0MzMzNDNkMWE5MWY5ZGVjODAwNjlmZWRjZmIyNGIwODZm
11
- MGNlMjgzOTU2YWUyNzAzYjhjNzNlMjg5MTYxZTU4NDBhZmJlOTE=
9
+ OTNmYjEyYjJkYmNjNDc2N2Y2ZmUxNTBjODlkZDJkM2NjYTAwYWRkNmJhOTBl
10
+ ZGI4MDcwZDVhNjkwY2VlZjIyZGNhYmJhZGFkODU4M2RjZWVlYWY3ZWQyZTFh
11
+ M2ZjYzdjZTYxZDc0NDcwMTM0NDFjZDg5YjI5YWExZGNhYTMyMDY=
12
12
  data.tar.gz: !binary |-
13
- OGRjMWExODhlZTFhMTE5ZTI4MjllYWNmZjAxZTg3NDk4NzQ4YmUxNGY3Njhk
14
- YjE4NmMxNDRlNDFmODE2OTEzNjYyMmRmZjQ2MDI0ZDlkOWJjMmNlNTk0OWUy
15
- Yzk3M2NmNjEwMjY4MGZmYmZmNTMyZWMyODFkMGNkZjUxOThjMjU=
13
+ MDllOGJlOWIyMzhmMDk5NWM2M2YwMDM3ZDI2NzY4ZTdlYzk4NjRhNjE5Y2Fj
14
+ NDM2MjA5MjQ2MTg5NTA2NWRlMWVlZWFhZDJmOTUyNDkwOTA4NjdhMTIwYWY4
15
+ NThmOTNiMGQ0YzJiMDBjZDAyOWQ1YmQwYzg5MGNjNzA1MTEwY2Q=
data/HISTORY.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## HEAD
2
2
 
3
+ ## 0.3.1 (2015-12-23)
4
+
5
+ * Fix edge case when zone file has multiple `ORIGIN` directives.
6
+
3
7
  ## 0.3.0 (2015-12-23)
4
8
 
5
9
  * Requires Ruby version >= 2.0
@@ -77,7 +77,9 @@ class DNS::Zone::RR::Record
77
77
 
78
78
  # unroll records nested under other origins
79
79
  unrolled_origin = options[:last_origin].sub(options[:origin], '').chomp('.') if options[:last_origin]
80
- @label = "#{@label}.#{unrolled_origin}" if unrolled_origin && !unrolled_origin.empty?
80
+ if unrolled_origin && !unrolled_origin.empty?
81
+ @label = @label == '@' ? unrolled_origin : "#{@label}.#{unrolled_origin}"
82
+ end
81
83
 
82
84
  @ttl = captures[:ttl]
83
85
  captures[:rdata]
@@ -1,6 +1,6 @@
1
1
  module DNS
2
2
  class Zone
3
3
  # Version number (major.minor.tiny)
4
- Version = '0.3.0'
4
+ Version = '0.3.1'
5
5
  end
6
6
  end
@@ -85,6 +85,7 @@ app1 60 A 1.2.3.4
85
85
  app2 60 A 1.2.3.5
86
86
  app3 60 A 1.2.3.6
87
87
  $ORIGIN another.lividpenguin.com.
88
+ @ 3600 A 1.1.1.1
88
89
  app1 60 A 4.3.2.1
89
90
 
90
91
  EOL
@@ -190,11 +191,13 @@ EOL
190
191
  def test_load_multiple_origins
191
192
  zone = DNS::Zone.load(ZONE_FILE_MULTIPLE_ORIGINS_EXAMPLE)
192
193
  assert_equal 'lividpenguin.com.', zone.origin
193
- assert_equal 11, zone.records.length, 'we should have multiple records (including SOA)'
194
+ assert_equal 12, zone.records.length, 'we should have multiple records (including SOA)'
194
195
  assert_equal 'app1.sub', zone.records[7].label
195
196
  assert_equal '1.2.3.4', zone.records[7].address
196
- assert_equal 'app1.another', zone.records[10].label
197
- assert_equal '4.3.2.1', zone.records[10].address
197
+ assert_equal 'another', zone.records[10].label
198
+ assert_equal '1.1.1.1', zone.records[10].address
199
+ assert_equal 'app1.another', zone.records[11].label
200
+ assert_equal '4.3.2.1', zone.records[11].address
198
201
  end
199
202
 
200
203
  def test_extract_entry_from_one_line
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns-zone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Antins