bind-zone-parser 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bind-zone-parser.gemspec +1 -1
- data/lib/bind/zone_parser.rb +802 -806
- data/lib/bind/zone_parser.rl +3 -3
- data/test/test_zone_parser.rb +6 -0
- metadata +3 -3
data/lib/bind/zone_parser.rl
CHANGED
@@ -32,8 +32,8 @@
|
|
32
32
|
action srv { record[:type] = :srv }
|
33
33
|
action cname { record[:type] = :cname }
|
34
34
|
|
35
|
-
action store_opt_ttl { @ttl = record[:ttl] }
|
36
|
-
action store_opt_origin { @origin = record[:domain] }
|
35
|
+
action store_opt_ttl { @ttl = record[:ttl]; record = Hash.new }
|
36
|
+
action store_opt_origin { @origin = record[:domain]; record = Hash.new }
|
37
37
|
|
38
38
|
sp = space+;
|
39
39
|
newline = "\n";
|
@@ -88,7 +88,7 @@
|
|
88
88
|
|
89
89
|
opt_ttl = "$TTL" sp ttl %store_opt_ttl;
|
90
90
|
opt_origin = "$ORIGIN" sp fqdname %store_opt_origin;
|
91
|
-
option = (opt_ttl | opt_origin)
|
91
|
+
option = (opt_ttl | opt_origin) newline;
|
92
92
|
|
93
93
|
main := (newline | comment | option | record)*;
|
94
94
|
}%%
|
data/test/test_zone_parser.rb
CHANGED
@@ -169,6 +169,9 @@ EOF
|
|
169
169
|
@zone_parser.parse("$TTL 144000\n")
|
170
170
|
assert_equal 144000, @zone_parser.ttl
|
171
171
|
end
|
172
|
+
should "not add a record" do
|
173
|
+
assert @zone_parser.parse("$TTL 144000\n").empty?
|
174
|
+
end
|
172
175
|
end
|
173
176
|
context "$ORIGIN option" do
|
174
177
|
should "parse the option" do
|
@@ -178,6 +181,9 @@ EOF
|
|
178
181
|
@zone_parser.parse("$ORIGIN example.com.\n")
|
179
182
|
assert_equal "example.com.", @zone_parser.origin
|
180
183
|
end
|
184
|
+
should "not add a record" do
|
185
|
+
assert @zone_parser.parse("$ORIGIN example.com.\n").empty?
|
186
|
+
end
|
181
187
|
end
|
182
188
|
end
|
183
189
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bind-zone-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Geoff Garside
|