dns-zone 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/lib/dns/zone/rr.rb +2 -1
- data/lib/dns/zone/rr/record.rb +2 -1
- data/lib/dns/zone/version.rb +1 -1
- data/test/rr_test.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43bf2ff0efe2b96de54bf7bbc3884a454a107c7f
|
4
|
+
data.tar.gz: 980b0210b442792230f6506d03ed5bd34455f361
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b0a1fc1c39fdb7c461b2b8fa9377532ca2124d82addc7efb4116640a9ba19c4201e5d2a06ca16385a69d8da191594af4346e8f6fe7d7b6a99ec2bc48f8a932a
|
7
|
+
data.tar.gz: a5d732f576b589ff0fd9d612e81e478fe4a28fc1270cecd8252f613c4b80e4766469ed94ba25ee9631a8352e4554a6485ec6288ec4233fad3fdf80a7da824bc9
|
data/HISTORY.md
CHANGED
data/lib/dns/zone/rr.rb
CHANGED
@@ -20,7 +20,8 @@ module DNS
|
|
20
20
|
# @return [Object]
|
21
21
|
def self.load(string, options = {})
|
22
22
|
# strip comments, unless its escaped.
|
23
|
-
|
23
|
+
# skip semicolons within "quote segments" (TXT records)
|
24
|
+
string.gsub!(/((?<!\\);)(?=(?:[^"]|"[^"]*")*$).*/o, "")
|
24
25
|
|
25
26
|
captures = string.match(REGEX_RR)
|
26
27
|
return nil unless captures
|
data/lib/dns/zone/rr/record.rb
CHANGED
@@ -63,7 +63,8 @@ class DNS::Zone::RR::Record
|
|
63
63
|
# @return [String] remaining RDATA
|
64
64
|
def load_general_and_get_rdata(string, options = {})
|
65
65
|
# strip comments, unless its escaped.
|
66
|
-
|
66
|
+
# skip semicolons within "quote segments" (TXT records)
|
67
|
+
string.gsub!(/((?<!\\);)(?=(?:[^"]|"[^"]*")*$).*/o, "")
|
67
68
|
|
68
69
|
captures = string.match(DNS::Zone::RR::REGEX_RR)
|
69
70
|
return nil unless captures
|
data/lib/dns/zone/version.rb
CHANGED
data/test/rr_test.rb
CHANGED
@@ -27,6 +27,14 @@ class RRTest < DNS::Zone::TestCase
|
|
27
27
|
assert_equal 'TXT', rr.type
|
28
28
|
assert_equal 'test text', rr.text
|
29
29
|
end
|
30
|
+
|
31
|
+
def test_load_txt_semicolon_rr
|
32
|
+
rr = DNS::Zone::RR.load('_domainkey IN TXT "t=y; o=~;"')
|
33
|
+
assert_instance_of DNS::Zone::RR::TXT, rr, 'should be instance of TXT RR'
|
34
|
+
assert_equal '_domainkey', rr.label
|
35
|
+
assert_equal 'TXT', rr.type
|
36
|
+
assert_equal 't=y; o=~;', rr.text
|
37
|
+
end
|
30
38
|
|
31
39
|
def test_load_a_rr_with_options_hash
|
32
40
|
rr = DNS::Zone::RR.load(' IN A 10.2.3.1', { last_label: 'www' })
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-zone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Antins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.
|
191
|
+
rubygems_version: 2.4.1
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: A Ruby library for building and parsing DNS zone files.
|