dns-zonefile 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/zonefile.treetop +10 -2
- data/lib/dns/zonefile/parser.rb +245 -61
- data/lib/dns/zonefile/version.rb +1 -1
- data/spec/dns/zonefile_spec.rb +3 -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: a1fa74b26db8e77edf6ee64246f6841de34265c3
|
4
|
+
data.tar.gz: a5965dc7fe66b4405d44715eb405250cca8bcbd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a23b7b78cabedf552fb781a2c98a3d66f171326b05556b3bf756ab0c04eb8626607b69dc476a47e7dcd51bffa7885c72a653af5260e9df29843e89d2cd964a0c
|
7
|
+
data.tar.gz: 02207318222c858dba68c37aac33458ad16f6b888b5cdfd271fc6bec810d4357a98617516653204f4448370725f147726ee40b4d83b0ad2e4723d7feff1db9e5
|
data/doc/zonefile.treetop
CHANGED
@@ -33,7 +33,7 @@ grammar Zonefile
|
|
33
33
|
end
|
34
34
|
|
35
35
|
rule variable
|
36
|
-
"$" name:([a-zA-Z0-9]+) space value:([a-zA-Z0-9\.\-]+) space? comment? {
|
36
|
+
"$" name:([a-zA-Z0-9]+) space value:([a-zA-Z0-9\.\-_]+) space? comment? {
|
37
37
|
def to_s
|
38
38
|
"$#{name.text_value.to_s} #{value.text_value.to_s}"
|
39
39
|
end
|
@@ -43,7 +43,7 @@ grammar Zonefile
|
|
43
43
|
end
|
44
44
|
|
45
45
|
rule soa
|
46
|
-
origin space ttl klass "SOA" space ns space rp space "("? space_or_break* serial space_or_break refresh space_or_break reretry space_or_break expiry space_or_break nxttl space_or_break* ")"? {
|
46
|
+
origin space ttl klass "SOA" space ns space rp space "("? multiline_comment* space_or_break* serial multiline_comment* space_or_break refresh multiline_comment* space_or_break reretry multiline_comment* space_or_break expiry multiline_comment* space_or_break nxttl multiline_comment* space_or_break* ")"? {
|
47
47
|
def to_s
|
48
48
|
"#{origin} #{ttl} #{klass} SOA #{ns} #{rp} (#{serial} #{refresh} #{reretry} #{expiry} #{nxttl})"
|
49
49
|
end
|
@@ -254,6 +254,14 @@ grammar Zonefile
|
|
254
254
|
}
|
255
255
|
end
|
256
256
|
|
257
|
+
rule multiline_comment
|
258
|
+
linebreak+ comment* {
|
259
|
+
def to_s
|
260
|
+
text_value.strip
|
261
|
+
end
|
262
|
+
}
|
263
|
+
end
|
264
|
+
|
257
265
|
rule space
|
258
266
|
[ \t]+ {
|
259
267
|
def to_s
|
data/lib/dns/zonefile/parser.rb
CHANGED
@@ -228,11 +228,11 @@ module DNS
|
|
228
228
|
if r4
|
229
229
|
s5, i5 = [], index
|
230
230
|
loop do
|
231
|
-
if has_terminal?(@regexps[gr = '\A[a-zA-Z0-9\\.\\-]'] ||= Regexp.new(gr), :regexp, index)
|
231
|
+
if has_terminal?(@regexps[gr = '\A[a-zA-Z0-9\\.\\-_]'] ||= Regexp.new(gr), :regexp, index)
|
232
232
|
r6 = true
|
233
233
|
@index += 1
|
234
234
|
else
|
235
|
-
terminal_parse_failure('[a-zA-Z0-9\\.\\-]')
|
235
|
+
terminal_parse_failure('[a-zA-Z0-9\\.\\-_]')
|
236
236
|
r6 = nil
|
237
237
|
end
|
238
238
|
if r6
|
@@ -321,39 +321,39 @@ module DNS
|
|
321
321
|
end
|
322
322
|
|
323
323
|
def serial
|
324
|
-
elements[
|
324
|
+
elements[13]
|
325
325
|
end
|
326
326
|
|
327
327
|
def space_or_break1
|
328
|
-
elements[
|
328
|
+
elements[15]
|
329
329
|
end
|
330
330
|
|
331
331
|
def refresh
|
332
|
-
elements[
|
332
|
+
elements[16]
|
333
333
|
end
|
334
334
|
|
335
335
|
def space_or_break2
|
336
|
-
elements[
|
336
|
+
elements[18]
|
337
337
|
end
|
338
338
|
|
339
339
|
def reretry
|
340
|
-
elements[
|
340
|
+
elements[19]
|
341
341
|
end
|
342
342
|
|
343
343
|
def space_or_break3
|
344
|
-
elements[
|
344
|
+
elements[21]
|
345
345
|
end
|
346
346
|
|
347
347
|
def expiry
|
348
|
-
elements[
|
348
|
+
elements[22]
|
349
349
|
end
|
350
350
|
|
351
351
|
def space_or_break4
|
352
|
-
elements[
|
352
|
+
elements[24]
|
353
353
|
end
|
354
354
|
|
355
355
|
def nxttl
|
356
|
-
elements[
|
356
|
+
elements[25]
|
357
357
|
end
|
358
358
|
|
359
359
|
end
|
@@ -430,7 +430,7 @@ module DNS
|
|
430
430
|
if r11
|
431
431
|
s13, i13 = [], index
|
432
432
|
loop do
|
433
|
-
r14 =
|
433
|
+
r14 = _nt_multiline_comment
|
434
434
|
if r14
|
435
435
|
s13 << r14
|
436
436
|
else
|
@@ -440,58 +440,136 @@ module DNS
|
|
440
440
|
r13 = instantiate_node(SyntaxNode,input, i13...index, s13)
|
441
441
|
s0 << r13
|
442
442
|
if r13
|
443
|
-
|
444
|
-
|
445
|
-
if r15
|
443
|
+
s15, i15 = [], index
|
444
|
+
loop do
|
446
445
|
r16 = _nt_space_or_break
|
447
|
-
s0 << r16
|
448
446
|
if r16
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
447
|
+
s15 << r16
|
448
|
+
else
|
449
|
+
break
|
450
|
+
end
|
451
|
+
end
|
452
|
+
r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
|
453
|
+
s0 << r15
|
454
|
+
if r15
|
455
|
+
r17 = _nt_serial
|
456
|
+
s0 << r17
|
457
|
+
if r17
|
458
|
+
s18, i18 = [], index
|
459
|
+
loop do
|
460
|
+
r19 = _nt_multiline_comment
|
461
|
+
if r19
|
462
|
+
s18 << r19
|
463
|
+
else
|
464
|
+
break
|
465
|
+
end
|
466
|
+
end
|
467
|
+
r18 = instantiate_node(SyntaxNode,input, i18...index, s18)
|
468
|
+
s0 << r18
|
469
|
+
if r18
|
470
|
+
r20 = _nt_space_or_break
|
471
|
+
s0 << r20
|
472
|
+
if r20
|
473
|
+
r21 = _nt_refresh
|
474
|
+
s0 << r21
|
475
|
+
if r21
|
476
|
+
s22, i22 = [], index
|
477
|
+
loop do
|
478
|
+
r23 = _nt_multiline_comment
|
479
|
+
if r23
|
480
|
+
s22 << r23
|
481
|
+
else
|
482
|
+
break
|
483
|
+
end
|
484
|
+
end
|
485
|
+
r22 = instantiate_node(SyntaxNode,input, i22...index, s22)
|
486
|
+
s0 << r22
|
487
|
+
if r22
|
488
|
+
r24 = _nt_space_or_break
|
489
|
+
s0 << r24
|
490
|
+
if r24
|
491
|
+
r25 = _nt_reretry
|
492
|
+
s0 << r25
|
493
|
+
if r25
|
494
|
+
s26, i26 = [], index
|
495
|
+
loop do
|
496
|
+
r27 = _nt_multiline_comment
|
497
|
+
if r27
|
498
|
+
s26 << r27
|
499
|
+
else
|
500
|
+
break
|
478
501
|
end
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
502
|
+
end
|
503
|
+
r26 = instantiate_node(SyntaxNode,input, i26...index, s26)
|
504
|
+
s0 << r26
|
505
|
+
if r26
|
506
|
+
r28 = _nt_space_or_break
|
507
|
+
s0 << r28
|
508
|
+
if r28
|
509
|
+
r29 = _nt_expiry
|
510
|
+
s0 << r29
|
511
|
+
if r29
|
512
|
+
s30, i30 = [], index
|
513
|
+
loop do
|
514
|
+
r31 = _nt_multiline_comment
|
515
|
+
if r31
|
516
|
+
s30 << r31
|
517
|
+
else
|
518
|
+
break
|
519
|
+
end
|
520
|
+
end
|
521
|
+
r30 = instantiate_node(SyntaxNode,input, i30...index, s30)
|
522
|
+
s0 << r30
|
523
|
+
if r30
|
524
|
+
r32 = _nt_space_or_break
|
525
|
+
s0 << r32
|
526
|
+
if r32
|
527
|
+
r33 = _nt_nxttl
|
528
|
+
s0 << r33
|
529
|
+
if r33
|
530
|
+
s34, i34 = [], index
|
531
|
+
loop do
|
532
|
+
r35 = _nt_multiline_comment
|
533
|
+
if r35
|
534
|
+
s34 << r35
|
535
|
+
else
|
536
|
+
break
|
537
|
+
end
|
538
|
+
end
|
539
|
+
r34 = instantiate_node(SyntaxNode,input, i34...index, s34)
|
540
|
+
s0 << r34
|
541
|
+
if r34
|
542
|
+
s36, i36 = [], index
|
543
|
+
loop do
|
544
|
+
r37 = _nt_space_or_break
|
545
|
+
if r37
|
546
|
+
s36 << r37
|
547
|
+
else
|
548
|
+
break
|
549
|
+
end
|
550
|
+
end
|
551
|
+
r36 = instantiate_node(SyntaxNode,input, i36...index, s36)
|
552
|
+
s0 << r36
|
553
|
+
if r36
|
554
|
+
if (match_len = has_terminal?(")", false, index))
|
555
|
+
r39 = true
|
556
|
+
@index += match_len
|
557
|
+
else
|
558
|
+
terminal_parse_failure('")"')
|
559
|
+
r39 = nil
|
560
|
+
end
|
561
|
+
if r39
|
562
|
+
r38 = r39
|
563
|
+
else
|
564
|
+
r38 = instantiate_node(SyntaxNode,input, index...index)
|
565
|
+
end
|
566
|
+
s0 << r38
|
567
|
+
end
|
568
|
+
end
|
569
|
+
end
|
570
|
+
end
|
571
|
+
end
|
493
572
|
end
|
494
|
-
s0 << r26
|
495
573
|
end
|
496
574
|
end
|
497
575
|
end
|
@@ -1097,10 +1175,11 @@ module DNS
|
|
1097
1175
|
r0 = nil
|
1098
1176
|
else
|
1099
1177
|
if s0.size < 39
|
1100
|
-
terminal_failures.pop
|
1178
|
+
@terminal_failures.pop
|
1101
1179
|
end
|
1102
1180
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
1103
1181
|
r0.extend(Ip6Address0)
|
1182
|
+
r0.extend(Ip6Address0)
|
1104
1183
|
end
|
1105
1184
|
|
1106
1185
|
node_cache[:ip6_address][start_index] = r0
|
@@ -1286,6 +1365,7 @@ module DNS
|
|
1286
1365
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
1287
1366
|
r0 = r1
|
1288
1367
|
r0.extend(CnameRecord4)
|
1368
|
+
r0.extend(CnameRecord4)
|
1289
1369
|
else
|
1290
1370
|
i10, s10 = index, []
|
1291
1371
|
r11 = _nt_host
|
@@ -1335,6 +1415,7 @@ module DNS
|
|
1335
1415
|
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
1336
1416
|
r0 = r10
|
1337
1417
|
r0.extend(CnameRecord4)
|
1418
|
+
r0.extend(CnameRecord4)
|
1338
1419
|
else
|
1339
1420
|
i19, s19 = index, []
|
1340
1421
|
r20 = _nt_host
|
@@ -1380,6 +1461,7 @@ module DNS
|
|
1380
1461
|
r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
|
1381
1462
|
r0 = r19
|
1382
1463
|
r0.extend(CnameRecord4)
|
1464
|
+
r0.extend(CnameRecord4)
|
1383
1465
|
else
|
1384
1466
|
i27, s27 = index, []
|
1385
1467
|
r28 = _nt_host
|
@@ -1421,6 +1503,7 @@ module DNS
|
|
1421
1503
|
r27 = SyntaxNode.new(input, (index-1)...index) if r27 == true
|
1422
1504
|
r0 = r27
|
1423
1505
|
r0.extend(CnameRecord4)
|
1506
|
+
r0.extend(CnameRecord4)
|
1424
1507
|
else
|
1425
1508
|
@index = i0
|
1426
1509
|
r0 = nil
|
@@ -2282,6 +2365,7 @@ module DNS
|
|
2282
2365
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
2283
2366
|
r0 = r1
|
2284
2367
|
r0.extend(SrvRecord4)
|
2368
|
+
r0.extend(SrvRecord4)
|
2285
2369
|
else
|
2286
2370
|
i16, s16 = index, []
|
2287
2371
|
r17 = _nt_host
|
@@ -2355,6 +2439,7 @@ module DNS
|
|
2355
2439
|
r16 = SyntaxNode.new(input, (index-1)...index) if r16 == true
|
2356
2440
|
r0 = r16
|
2357
2441
|
r0.extend(SrvRecord4)
|
2442
|
+
r0.extend(SrvRecord4)
|
2358
2443
|
else
|
2359
2444
|
i31, s31 = index, []
|
2360
2445
|
r32 = _nt_host
|
@@ -2424,6 +2509,7 @@ module DNS
|
|
2424
2509
|
r31 = SyntaxNode.new(input, (index-1)...index) if r31 == true
|
2425
2510
|
r0 = r31
|
2426
2511
|
r0.extend(SrvRecord4)
|
2512
|
+
r0.extend(SrvRecord4)
|
2427
2513
|
else
|
2428
2514
|
i45, s45 = index, []
|
2429
2515
|
r46 = _nt_host
|
@@ -2489,6 +2575,7 @@ module DNS
|
|
2489
2575
|
r45 = SyntaxNode.new(input, (index-1)...index) if r45 == true
|
2490
2576
|
r0 = r45
|
2491
2577
|
r0.extend(SrvRecord4)
|
2578
|
+
r0.extend(SrvRecord4)
|
2492
2579
|
else
|
2493
2580
|
@index = i0
|
2494
2581
|
r0 = nil
|
@@ -2760,6 +2847,70 @@ module DNS
|
|
2760
2847
|
r0
|
2761
2848
|
end
|
2762
2849
|
|
2850
|
+
module MultilineComment0
|
2851
|
+
end
|
2852
|
+
|
2853
|
+
module MultilineComment1
|
2854
|
+
def to_s
|
2855
|
+
text_value.strip
|
2856
|
+
end
|
2857
|
+
end
|
2858
|
+
|
2859
|
+
def _nt_multiline_comment
|
2860
|
+
start_index = index
|
2861
|
+
if node_cache[:multiline_comment].has_key?(index)
|
2862
|
+
cached = node_cache[:multiline_comment][index]
|
2863
|
+
if cached
|
2864
|
+
node_cache[:multiline_comment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
|
2865
|
+
@index = cached.interval.end
|
2866
|
+
end
|
2867
|
+
return cached
|
2868
|
+
end
|
2869
|
+
|
2870
|
+
i0, s0 = index, []
|
2871
|
+
s1, i1 = [], index
|
2872
|
+
loop do
|
2873
|
+
r2 = _nt_linebreak
|
2874
|
+
if r2
|
2875
|
+
s1 << r2
|
2876
|
+
else
|
2877
|
+
break
|
2878
|
+
end
|
2879
|
+
end
|
2880
|
+
if s1.empty?
|
2881
|
+
@index = i1
|
2882
|
+
r1 = nil
|
2883
|
+
else
|
2884
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
2885
|
+
end
|
2886
|
+
s0 << r1
|
2887
|
+
if r1
|
2888
|
+
s3, i3 = [], index
|
2889
|
+
loop do
|
2890
|
+
r4 = _nt_comment
|
2891
|
+
if r4
|
2892
|
+
s3 << r4
|
2893
|
+
else
|
2894
|
+
break
|
2895
|
+
end
|
2896
|
+
end
|
2897
|
+
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
|
2898
|
+
s0 << r3
|
2899
|
+
end
|
2900
|
+
if s0.last
|
2901
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2902
|
+
r0.extend(MultilineComment0)
|
2903
|
+
r0.extend(MultilineComment1)
|
2904
|
+
else
|
2905
|
+
@index = i0
|
2906
|
+
r0 = nil
|
2907
|
+
end
|
2908
|
+
|
2909
|
+
node_cache[:multiline_comment][start_index] = r0
|
2910
|
+
|
2911
|
+
r0
|
2912
|
+
end
|
2913
|
+
|
2763
2914
|
module Space0
|
2764
2915
|
def to_s
|
2765
2916
|
text_value
|
@@ -2798,6 +2949,7 @@ module DNS
|
|
2798
2949
|
else
|
2799
2950
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2800
2951
|
r0.extend(Space0)
|
2952
|
+
r0.extend(Space0)
|
2801
2953
|
end
|
2802
2954
|
|
2803
2955
|
node_cache[:space][start_index] = r0
|
@@ -2843,6 +2995,7 @@ module DNS
|
|
2843
2995
|
else
|
2844
2996
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2845
2997
|
r0.extend(Linebreak0)
|
2998
|
+
r0.extend(Linebreak0)
|
2846
2999
|
end
|
2847
3000
|
|
2848
3001
|
node_cache[:linebreak][start_index] = r0
|
@@ -2888,6 +3041,7 @@ module DNS
|
|
2888
3041
|
else
|
2889
3042
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
2890
3043
|
r0.extend(SpaceOrBreak0)
|
3044
|
+
r0.extend(SpaceOrBreak0)
|
2891
3045
|
end
|
2892
3046
|
|
2893
3047
|
node_cache[:space_or_break][start_index] = r0
|
@@ -2943,6 +3097,7 @@ module DNS
|
|
2943
3097
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
2944
3098
|
r0 = r1
|
2945
3099
|
r0.extend(Klass1)
|
3100
|
+
r0.extend(Klass1)
|
2946
3101
|
else
|
2947
3102
|
if (match_len = has_terminal?('', false, index))
|
2948
3103
|
r4 = true
|
@@ -2955,6 +3110,7 @@ module DNS
|
|
2955
3110
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
2956
3111
|
r0 = r4
|
2957
3112
|
r0.extend(Klass1)
|
3113
|
+
r0.extend(Klass1)
|
2958
3114
|
else
|
2959
3115
|
@index = i0
|
2960
3116
|
r0 = nil
|
@@ -3184,6 +3340,7 @@ module DNS
|
|
3184
3340
|
else
|
3185
3341
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
3186
3342
|
r0.extend(Rp1)
|
3343
|
+
r0.extend(Rp1)
|
3187
3344
|
end
|
3188
3345
|
|
3189
3346
|
node_cache[:rp][start_index] = r0
|
@@ -3398,6 +3555,7 @@ module DNS
|
|
3398
3555
|
else
|
3399
3556
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
3400
3557
|
r0.extend(Integer0)
|
3558
|
+
r0.extend(Integer0)
|
3401
3559
|
end
|
3402
3560
|
|
3403
3561
|
node_cache[:integer][start_index] = r0
|
@@ -3444,6 +3602,7 @@ module DNS
|
|
3444
3602
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
3445
3603
|
r0 = r1
|
3446
3604
|
r0.extend(TimeMultiplier0)
|
3605
|
+
r0.extend(TimeMultiplier0)
|
3447
3606
|
else
|
3448
3607
|
if (match_len = has_terminal?('S', false, index))
|
3449
3608
|
r2 = true
|
@@ -3456,6 +3615,7 @@ module DNS
|
|
3456
3615
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
3457
3616
|
r0 = r2
|
3458
3617
|
r0.extend(TimeMultiplier0)
|
3618
|
+
r0.extend(TimeMultiplier0)
|
3459
3619
|
else
|
3460
3620
|
if (match_len = has_terminal?('m', false, index))
|
3461
3621
|
r3 = true
|
@@ -3468,6 +3628,7 @@ module DNS
|
|
3468
3628
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
3469
3629
|
r0 = r3
|
3470
3630
|
r0.extend(TimeMultiplier0)
|
3631
|
+
r0.extend(TimeMultiplier0)
|
3471
3632
|
else
|
3472
3633
|
if (match_len = has_terminal?('M', false, index))
|
3473
3634
|
r4 = true
|
@@ -3480,6 +3641,7 @@ module DNS
|
|
3480
3641
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
3481
3642
|
r0 = r4
|
3482
3643
|
r0.extend(TimeMultiplier0)
|
3644
|
+
r0.extend(TimeMultiplier0)
|
3483
3645
|
else
|
3484
3646
|
if (match_len = has_terminal?('h', false, index))
|
3485
3647
|
r5 = true
|
@@ -3492,6 +3654,7 @@ module DNS
|
|
3492
3654
|
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
3493
3655
|
r0 = r5
|
3494
3656
|
r0.extend(TimeMultiplier0)
|
3657
|
+
r0.extend(TimeMultiplier0)
|
3495
3658
|
else
|
3496
3659
|
if (match_len = has_terminal?('H', false, index))
|
3497
3660
|
r6 = true
|
@@ -3504,6 +3667,7 @@ module DNS
|
|
3504
3667
|
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
3505
3668
|
r0 = r6
|
3506
3669
|
r0.extend(TimeMultiplier0)
|
3670
|
+
r0.extend(TimeMultiplier0)
|
3507
3671
|
else
|
3508
3672
|
if (match_len = has_terminal?('d', false, index))
|
3509
3673
|
r7 = true
|
@@ -3516,6 +3680,7 @@ module DNS
|
|
3516
3680
|
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
3517
3681
|
r0 = r7
|
3518
3682
|
r0.extend(TimeMultiplier0)
|
3683
|
+
r0.extend(TimeMultiplier0)
|
3519
3684
|
else
|
3520
3685
|
if (match_len = has_terminal?('D', false, index))
|
3521
3686
|
r8 = true
|
@@ -3528,6 +3693,7 @@ module DNS
|
|
3528
3693
|
r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
|
3529
3694
|
r0 = r8
|
3530
3695
|
r0.extend(TimeMultiplier0)
|
3696
|
+
r0.extend(TimeMultiplier0)
|
3531
3697
|
else
|
3532
3698
|
if (match_len = has_terminal?('w', false, index))
|
3533
3699
|
r9 = true
|
@@ -3540,6 +3706,7 @@ module DNS
|
|
3540
3706
|
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
3541
3707
|
r0 = r9
|
3542
3708
|
r0.extend(TimeMultiplier0)
|
3709
|
+
r0.extend(TimeMultiplier0)
|
3543
3710
|
else
|
3544
3711
|
if (match_len = has_terminal?('W', false, index))
|
3545
3712
|
r10 = true
|
@@ -3552,6 +3719,7 @@ module DNS
|
|
3552
3719
|
r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
|
3553
3720
|
r0 = r10
|
3554
3721
|
r0.extend(TimeMultiplier0)
|
3722
|
+
r0.extend(TimeMultiplier0)
|
3555
3723
|
else
|
3556
3724
|
if (match_len = has_terminal?('', false, index))
|
3557
3725
|
r11 = true
|
@@ -3564,6 +3732,7 @@ module DNS
|
|
3564
3732
|
r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
|
3565
3733
|
r0 = r11
|
3566
3734
|
r0.extend(TimeMultiplier0)
|
3735
|
+
r0.extend(TimeMultiplier0)
|
3567
3736
|
else
|
3568
3737
|
@index = i0
|
3569
3738
|
r0 = nil
|
@@ -3837,6 +4006,7 @@ module DNS
|
|
3837
4006
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
3838
4007
|
r0 = r1
|
3839
4008
|
r0.extend(MsAge1)
|
4009
|
+
r0.extend(MsAge1)
|
3840
4010
|
else
|
3841
4011
|
if (match_len = has_terminal?('', false, index))
|
3842
4012
|
r7 = true
|
@@ -3849,6 +4019,7 @@ module DNS
|
|
3849
4019
|
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
3850
4020
|
r0 = r7
|
3851
4021
|
r0.extend(MsAge1)
|
4022
|
+
r0.extend(MsAge1)
|
3852
4023
|
else
|
3853
4024
|
@index = i0
|
3854
4025
|
r0 = nil
|
@@ -3909,6 +4080,7 @@ module DNS
|
|
3909
4080
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
3910
4081
|
r0 = r1
|
3911
4082
|
r0.extend(Ttl1)
|
4083
|
+
r0.extend(Ttl1)
|
3912
4084
|
else
|
3913
4085
|
if (match_len = has_terminal?('', false, index))
|
3914
4086
|
r4 = true
|
@@ -3921,6 +4093,7 @@ module DNS
|
|
3921
4093
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
3922
4094
|
r0 = r4
|
3923
4095
|
r0.extend(Ttl1)
|
4096
|
+
r0.extend(Ttl1)
|
3924
4097
|
else
|
3925
4098
|
@index = i0
|
3926
4099
|
r0 = nil
|
@@ -3982,6 +4155,7 @@ module DNS
|
|
3982
4155
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
3983
4156
|
r0 = r1
|
3984
4157
|
r0.extend(Host0)
|
4158
|
+
r0.extend(Host0)
|
3985
4159
|
else
|
3986
4160
|
if (match_len = has_terminal?("@", false, index))
|
3987
4161
|
r3 = true
|
@@ -3994,6 +4168,7 @@ module DNS
|
|
3994
4168
|
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
3995
4169
|
r0 = r3
|
3996
4170
|
r0.extend(Host0)
|
4171
|
+
r0.extend(Host0)
|
3997
4172
|
else
|
3998
4173
|
if (match_len = has_terminal?(' ', false, index))
|
3999
4174
|
r4 = true
|
@@ -4006,6 +4181,7 @@ module DNS
|
|
4006
4181
|
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
4007
4182
|
r0 = r4
|
4008
4183
|
r0.extend(Host0)
|
4184
|
+
r0.extend(Host0)
|
4009
4185
|
else
|
4010
4186
|
if (match_len = has_terminal?("\t", false, index))
|
4011
4187
|
r5 = true
|
@@ -4018,6 +4194,7 @@ module DNS
|
|
4018
4194
|
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
4019
4195
|
r0 = r5
|
4020
4196
|
r0.extend(Host0)
|
4197
|
+
r0.extend(Host0)
|
4021
4198
|
else
|
4022
4199
|
@index = i0
|
4023
4200
|
r0 = nil
|
@@ -4069,6 +4246,7 @@ module DNS
|
|
4069
4246
|
else
|
4070
4247
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4071
4248
|
r0.extend(Data0)
|
4249
|
+
r0.extend(Data0)
|
4072
4250
|
end
|
4073
4251
|
|
4074
4252
|
node_cache[:data][start_index] = r0
|
@@ -4167,6 +4345,7 @@ module DNS
|
|
4167
4345
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
4168
4346
|
r0 = r1
|
4169
4347
|
r0.extend(MsTxtData2)
|
4348
|
+
r0.extend(MsTxtData2)
|
4170
4349
|
else
|
4171
4350
|
i9, s9 = index, []
|
4172
4351
|
r10 = _nt_txt_data
|
@@ -4182,6 +4361,7 @@ module DNS
|
|
4182
4361
|
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
|
4183
4362
|
r0 = r9
|
4184
4363
|
r0.extend(MsTxtData2)
|
4364
|
+
r0.extend(MsTxtData2)
|
4185
4365
|
else
|
4186
4366
|
@index = i0
|
4187
4367
|
r0 = nil
|
@@ -4293,12 +4473,14 @@ module DNS
|
|
4293
4473
|
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
4294
4474
|
r0 = r1
|
4295
4475
|
r0.extend(TxtString0)
|
4476
|
+
r0.extend(TxtString0)
|
4296
4477
|
else
|
4297
4478
|
r2 = _nt_unquoted_string
|
4298
4479
|
if r2
|
4299
4480
|
r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
|
4300
4481
|
r0 = r2
|
4301
4482
|
r0.extend(TxtString0)
|
4483
|
+
r0.extend(TxtString0)
|
4302
4484
|
else
|
4303
4485
|
@index = i0
|
4304
4486
|
r0 = nil
|
@@ -4391,6 +4573,7 @@ module DNS
|
|
4391
4573
|
if s0.last
|
4392
4574
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4393
4575
|
r0.extend(QuotedString0)
|
4576
|
+
r0.extend(QuotedString1)
|
4394
4577
|
else
|
4395
4578
|
@index = i0
|
4396
4579
|
r0 = nil
|
@@ -4439,6 +4622,7 @@ module DNS
|
|
4439
4622
|
else
|
4440
4623
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
4441
4624
|
r0.extend(UnquotedString0)
|
4625
|
+
r0.extend(UnquotedString0)
|
4442
4626
|
end
|
4443
4627
|
|
4444
4628
|
node_cache[:unquoted_string][start_index] = r0
|
data/lib/dns/zonefile/version.rb
CHANGED
data/spec/dns/zonefile_spec.rb
CHANGED
@@ -21,7 +21,10 @@ $TTL 86400; expire in 1 day.
|
|
21
21
|
$OTHER abc
|
22
22
|
; line above has spaces at the end, but no comment
|
23
23
|
@ IN SOA ns.example.com. hostmaster\\.awesome.example.com. (
|
24
|
+
;
|
24
25
|
2007120710 ; serial number of this zone file
|
26
|
+
;two
|
27
|
+
;comments
|
25
28
|
1d ; slave refresh (1 day)
|
26
29
|
1d ; slave retry time in case of a problem (1 day)
|
27
30
|
4W ; slave expiration time (4 weeks)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-zonefile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig R Webster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project: dns-zonefile
|
120
|
-
rubygems_version: 2.4.5
|
120
|
+
rubygems_version: 2.4.5.1
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)
|