dns-zonefile 1.1.3 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d2cf8f81008cd088e5a4beb910bdd6fac23bc21
4
- data.tar.gz: 9585b78227f0ec5b9fe993c108febfc20962c9fe
3
+ metadata.gz: 0361c4e2fc9b1f336864f2524144ee3546394aae
4
+ data.tar.gz: a0e80ab3d8b4fc5c2a82ab9ac09e87639a72bfd2
5
5
  SHA512:
6
- metadata.gz: d361f79d9ea5ff9f0ff49ce4bb21d3c31e2e4794169c752edd78e51f3d0d90641b8bd6eea1d79f1c248ed5031485036f8102ffce5a5942054c9f51d28dc9bcb3
7
- data.tar.gz: b281a14ab6d5bfa7cfbfa48f9012daad168ab87ed6bc3bfa2d25c89d581d0127908e5b4fa5e603d427b13de78f770d6815d2bd1d0a0dd7f05231495487f42c28
6
+ metadata.gz: 05a9ebecede7d0eeb901b135b1097dd484a6eb6bd63ab89fa7ff3d5325014ec6dc9025f90e58cbcc88203ac0dfd3f9cac91a285551e617d32cfc1f8a5aebd266
7
+ data.tar.gz: 168247fe3ef6308ae9ed5bef39f29a4bb3b331e41c361681d7979afab3ea043383eb898ec770ee9c1bea937bb1df715584445195c77be430e9e33fc32e90e5fb
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.3
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,32 @@
1
+ # Contributing to dns-zonefile
2
+
3
+ ## Getting started
4
+
5
+ Clone the repository and move into it:
6
+
7
+ ```
8
+ $ git clone git@github.com:craigw/dns-zonefile.git
9
+ $ cd dns-zonefile
10
+ ```
11
+
12
+ Install the dependencies using [Bundler](http://bundler.io/):
13
+
14
+ ```
15
+ $ bundle
16
+ ```
17
+
18
+ [Run the test suite](#testing) to check everything works as expected.
19
+
20
+
21
+ ## Testing
22
+
23
+ To run the test suite:
24
+
25
+ ```
26
+ $ rake
27
+ ```
28
+
29
+
30
+ ## Tests
31
+
32
+ Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing).
data/README.md CHANGED
@@ -11,21 +11,14 @@ some canonical form.
11
11
 
12
12
  ## Getting setup
13
13
 
14
- Well, you'll need the treetop and polyglot gems installed. They do all
15
- the hard work. Thanks!
14
+ Add `gem dns-zonefile` to your Gemfile
16
15
 
17
- sudo gem install treetop polyglot
16
+ or
18
17
 
19
- Now you'll need to generate the Treetop parser from the Zonefile grammar
20
- that I've hacked together.
21
-
22
- rake generate_grammar
18
+ `gem install dns-zonefile`
23
19
 
24
20
  Okay, you're ready to move onto the examples now.
25
21
 
26
- The above steps should not be necessary if you install the gem via rubygems.
27
-
28
-
29
22
  ## Examples
30
23
 
31
24
  Using raw data from the parser. Note that "@" isn't translated in this mode.
@@ -54,19 +47,22 @@ handled in this mode.
54
47
  # get all MX records
55
48
  puts zone.records_of(DNS::Zonefile::MX)
56
49
 
50
+ Open the examples in the `./examples` directory to see more examples.
57
51
 
58
52
  ## Authors
59
53
 
60
- Original code and concept:
54
+ ### Original code and concept:
55
+
61
56
  Craig R Webster <http://barkingiguana.com/>
62
57
 
63
- Additions:
64
- t.e.morgan <http://zerigo.com/>
58
+ ### Additions:
59
+
60
+ - t.e.morgan <http://zerigo.com/>
61
+ - Anthony Eden <https://dnsimple.com/>
65
62
 
66
63
 
67
64
  ## Contributing
68
65
 
69
- See the TODO. Send me patches or pull request either by email or on
70
- GitHub.
66
+ See the TODO. Read CONTRIBUTING.md for more details on how to contribute to this project.
71
67
 
72
68
  [![Build Status](https://secure.travis-ci.org/craigw/dns-zonefile.png)](http://travis-ci.org/craigw/dns-zonefile)
data/dns-zonefile.gemspec CHANGED
@@ -6,8 +6,8 @@ require 'dns/zonefile/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "dns-zonefile"
8
8
  spec.version = DNS::Zonefile::VERSION
9
- spec.authors = ["Craig R Webster"]
10
- spec.email = ["craig@barkingiguana.com"]
9
+ spec.authors = ["Craig R Webster", "Anthony Eden"]
10
+ spec.email = ["craig@barkingiguana.com", "anthonyeden@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)}
13
13
  spec.description = <<-EOD
data/examples/basic.rb ADDED
@@ -0,0 +1,12 @@
1
+ # First make sure you have installed the `dns-zonefile` gem.
2
+ #
3
+ # Run this script with `ruby basic.rb`
4
+
5
+ require 'dns/zonefile'
6
+
7
+ zonefile = "example.com.zonefile"
8
+ zone = DNS::Zonefile.parse(File.read(zonefile))
9
+
10
+ puts zone.soa.origin.to_s
11
+ puts zone.soa.ns.to_s
12
+ puts zone.rr[0].to_s
@@ -0,0 +1,15 @@
1
+ # First make sure you have installed the `dns-zonefile` gem.
2
+ #
3
+ # Run this script with `ruby basic.rb`
4
+
5
+ require 'dns/zonefile'
6
+
7
+ zonefile = "example.com.zonefile"
8
+ zone = DNS::Zonefile.load(File.read(zonefile), 'example.com.')
9
+
10
+ puts zone.soa.origin
11
+ puts zone.soa.nameserver
12
+ # get all MX records
13
+ zone.records_of(DNS::Zonefile::MX).each do |rec|
14
+ puts "#{rec.host} #{rec.klass} #{rec.ttl} #{rec.priority} #{rec.domainname}"
15
+ end
@@ -0,0 +1,16 @@
1
+ $TTL 1h ; default expiration time of all resource records without their own TTL value
2
+ example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )
3
+ example.com. IN NS ns ; ns.example.com is a nameserver for example.com
4
+ example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com
5
+ example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com
6
+ @ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin
7
+ @ IN MX 50 mail3 ; equivalent to above line, but using a relative host name
8
+ example.com. IN A 192.0.2.1 ; IPv4 address for example.com
9
+ IN AAAA 2001:db8:10::1 ; IPv6 address for example.com
10
+ ns IN A 192.0.2.2 ; IPv4 address for ns.example.com
11
+ IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com
12
+ www IN CNAME example.com. ; www.example.com is an alias for example.com
13
+ wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com
14
+ mail IN A 192.0.2.3 ; IPv4 address for mail.example.com
15
+ mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com
16
+ mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com
@@ -0,0 +1,17 @@
1
+ $ORIGIN example.com. ; designates the start of this zone file in the namespace
2
+ $TTL 1h ; default expiration time of all resource records without their own TTL value
3
+ example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )
4
+ example.com. IN NS ns ; ns.example.com is a nameserver for example.com
5
+ example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com
6
+ example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com
7
+ @ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin
8
+ @ IN MX 50 mail3 ; equivalent to above line, but using a relative host name
9
+ example.com. IN A 192.0.2.1 ; IPv4 address for example.com
10
+ IN AAAA 2001:db8:10::1 ; IPv6 address for example.com
11
+ ns IN A 192.0.2.2 ; IPv4 address for ns.example.com
12
+ IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com
13
+ www IN CNAME example.com. ; www.example.com is an alias for example.com
14
+ wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com
15
+ mail IN A 192.0.2.3 ; IPv4 address for mail.example.com
16
+ mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com
17
+ mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com
@@ -505,7 +505,7 @@ grammar Zonefile
505
505
  end
506
506
 
507
507
  rule unquoted_string
508
- [a-zA-Z0-9]+ {
508
+ [a-zA-Z0-9=]+ {
509
509
  def to_s
510
510
  text_value
511
511
  end
@@ -1,5 +1,5 @@
1
1
  module DNS
2
2
  module Zonefile
3
- VERSION = "1.1.3"
3
+ VERSION = "1.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns-zonefile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig R Webster
8
+ - Anthony Eden
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2016-06-27 00:00:00.000000000 Z
12
+ date: 2016-12-26 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: treetop
@@ -90,12 +91,15 @@ description: |
90
91
  some canonical form.
91
92
  email:
92
93
  - craig@barkingiguana.com
94
+ - anthonyeden@gmail.com
93
95
  executables: []
94
96
  extensions: []
95
97
  extra_rdoc_files: []
96
98
  files:
97
99
  - ".gitignore"
98
100
  - ".rspec"
101
+ - ".travis.yml"
102
+ - CONTRIBUTING.md
99
103
  - Dockerfile
100
104
  - Gemfile
101
105
  - LICENCE
@@ -111,6 +115,10 @@ files:
111
115
  - doc/example3.com.zone
112
116
  - doc/zonefile.example
113
117
  - docker-compose.yml
118
+ - examples/basic.rb
119
+ - examples/basic_origin.rb
120
+ - examples/example.com.no-origin.zonefile
121
+ - examples/example.com.zonefile
114
122
  - lib/dns/zonefile.rb
115
123
  - lib/dns/zonefile.treetop
116
124
  - lib/dns/zonefile/version.rb
@@ -134,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
142
  version: '0'
135
143
  requirements: []
136
144
  rubyforge_project:
137
- rubygems_version: 2.4.5.1
145
+ rubygems_version: 2.5.1
138
146
  signing_key:
139
147
  specification_version: 4
140
148
  summary: Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)