rubydns 2.0.0.pre.rc2 → 2.0.0

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: 47425116bb864b8110d9e465a3291eb2b4f2ee42
4
- data.tar.gz: d4383036d994ae8c1b34a63f226a450d4788898e
3
+ metadata.gz: bac5139eae169f981088495e6dc4bde5d13fa966
4
+ data.tar.gz: 0ee8216c43d6600fb811ee83d708ac984d2807df
5
5
  SHA512:
6
- metadata.gz: e4d19115248fe790140c5e7d28fd2aaa8f5c79d6acc1cf1fcf8df9ef01e33be4403a7481b64e78e5ed3f032d9105184681e007102f166aa4bef6d21fd1efeb78
7
- data.tar.gz: 9a4c50b77cc30929fa6d43255645d36091e81966e5c2dd521bf5cf501f0e9593a201fac804fadc5742f8681506c9d63882be6168f3c0ed347a072eebda669a0d
6
+ metadata.gz: caa862959c454afebceddbf387e5722ff6a013a6c1c6012f5cb5acf1ec4d6c9422ea1c641fb3b776ecd270ec9278640e6b7088b64cbcea9ce8e8783c579f45a1
7
+ data.tar.gz: 136467f2543e9eb1ae01b158cca987ec1757d01bd2aa10c695249a204a68a8e88137b39cc907f4bf9cc544c9046a94848542fddde3578f6bf553459e1c81c9bf
data/README.md CHANGED
@@ -47,7 +47,7 @@ IN = Resolv::DNS::Resource::IN
47
47
  UPSTREAM = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
48
48
 
49
49
  # Start the RubyDNS server
50
- RubyDNS::run_server(:listen => INTERFACES) do
50
+ RubyDNS::run_server(INTERFACES) do
51
51
  match(%r{test.local}, IN::A) do |transaction|
52
52
  transaction.respond!("10.0.0.80")
53
53
  end
@@ -68,7 +68,7 @@ Start the server using `RUBYOPT=-w ./examples/basic-dns.rb`. You can then test i
68
68
 
69
69
  On some platforms (e.g. Mac OS X) the number of file descriptors is relatively low by default and should be increased by calling `ulimit -n 10000` before running tests or even before starting a server which expects a large number of concurrent incoming connections.
70
70
 
71
- ### Custom servers
71
+ ### Custom Servers
72
72
 
73
73
  It is possible to create and integrate your own custom servers, however this functionality has now moved to [`Async::DNS::Server`](https://github.com/socketry/async-dns).
74
74
 
@@ -135,11 +135,19 @@ DNSSEC is currently not supported and is [unlikely to be supported in the future
135
135
  * Support reverse records more easily.
136
136
  * Some kind of system level integration, e.g. registering a DNS server with the currently running system resolver.
137
137
 
138
+ ## See Also
139
+
140
+ The majority of this gem is now implemented by `async-dns`.
141
+
142
+ - [async-io](https://github.com/socketry/async-io) — Asynchronous networking and sockets.
143
+ - [async-dns](https://github.com/socketry/async-dns) — Asynchronous DNS resolver and server.
144
+ - [async-rspec](https://github.com/socketry/async-rspec) — Shared contexts for running async specs.
145
+
138
146
  ## License
139
147
 
140
148
  Released under the MIT license.
141
149
 
142
- Copyright, 2009, 2012, 2014, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
150
+ Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
143
151
 
144
152
  Permission is hereby granted, free of charge, to any person obtaining a copy
145
153
  of this software and associated documentation files (the "Software"), to deal
@@ -12,7 +12,7 @@ IN = Resolv::DNS::Resource::IN
12
12
  UPSTREAM = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
13
13
 
14
14
  # Start the RubyDNS server
15
- RubyDNS::run_server(:listen => INTERFACES) do
15
+ RubyDNS::run_server(INTERFACES) do
16
16
  match(%r{test.local}, IN::A) do |transaction|
17
17
  transaction.respond!("10.0.0.80")
18
18
  end
@@ -13,7 +13,7 @@ IN = Resolv::DNS::Resource::IN
13
13
 
14
14
  UPSTREAM = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
15
15
 
16
- RubyDNS::run_server(:listen => INTERFACES) do
16
+ RubyDNS::run_server(INTERFACES) do
17
17
  # How to respond to something other than what was requested.
18
18
  match(//, IN::A) do |transaction|
19
19
  transaction.respond!(Name.create('foo.bar'), resource_class: IN::CNAME)
@@ -38,7 +38,7 @@ class FlakeyDNS < Process::Daemon
38
38
  IN = Resolv::DNS::Resource::IN
39
39
 
40
40
  def startup
41
- RubyDNS.run_server(listen: INTERFACES) do
41
+ RubyDNS.run_server(INTERFACES) do
42
42
  # Use a Celluloid supervisor so the system recovers if the actor dies
43
43
  fallback_resolver_supervisor =
44
44
  RubyDNS::Resolver.supervise(RubyDNS::System.nameservers)
@@ -57,7 +57,7 @@ class GeoIPDNS < Process::Daemon
57
57
  IN = Resolv::DNS::Resource::IN
58
58
 
59
59
  def startup
60
- RubyDNS.run_server(listen: INTERFACES) do
60
+ RubyDNS.run_server(INTERFACES) do
61
61
  fallback_resolver_supervisor = RubyDNS::Resolver.supervise(RubyDNS::System.nameservers)
62
62
 
63
63
  match(//, IN::A) do |transaction|
@@ -13,7 +13,7 @@ IN = Resolv::DNS::Resource::IN
13
13
  UPSTREAM = RubyDNS::Resolver.new([[:udp, '8.8.8.8', 53], [:tcp, '8.8.8.8', 53]])
14
14
 
15
15
  # Start the RubyDNS server
16
- RubyDNS.run_server(listen: INTERFACES) do
16
+ RubyDNS.run_server(INTERFACES) do
17
17
  match(/test.mydomain.org/, IN::A) do |transaction|
18
18
  transaction.respond!('10.0.0.80')
19
19
  end
@@ -27,7 +27,7 @@ $R = Resolv::DNS.new
27
27
  Name = Resolv::DNS::Name
28
28
  IN = Resolv::DNS::Resource::IN
29
29
 
30
- RubyDNS.run_server(listen: [[:udp, '0.0.0.0', 5400]]) do
30
+ RubyDNS.run_server([[:udp, '0.0.0.0', 5400]]) do
31
31
  # SOA Record
32
32
  # dig @localhost -p 5400 SOA mydomain.org
33
33
  match('mydomain.org', IN::SOA) do |transaction|
@@ -37,7 +37,7 @@ INTERFACES = [
37
37
  # [:tcp, '::0', 5300],
38
38
  ]
39
39
 
40
- RubyDNS.run_server(listen: INTERFACES) do
40
+ RubyDNS.run_server(INTERFACES) do
41
41
  # % dig +nocmd +noall +answer @localhost ANY dev.mydomain.org
42
42
  # dev.mydomain.org. 16000 IN A 10.0.0.80
43
43
  # dev.mydomain.org. 16000 IN MX 10 mail.mydomain.org.
@@ -61,7 +61,7 @@ class Server < Process::Daemon
61
61
  $stderr.sync = true
62
62
 
63
63
  # Start the RubyDNS server
64
- RubyDNS.run_server(listen: INTERFACES) do
64
+ RubyDNS.run_server(INTERFACES) do
65
65
  on(:start) do
66
66
  RExec.change_user(RUN_AS)
67
67
  end
@@ -28,8 +28,13 @@ module RubyDNS
28
28
  Resolver = Async::DNS::Resolver
29
29
 
30
30
  # Run a server with the given rules.
31
- def self.run_server (server_class: RuleBasedServer, **options, &block)
32
- server = server_class.new(**options, &block)
31
+ def self.run_server (*args, server_class: RuleBasedServer, **options, &block)
32
+ if listen = options.delete(:listen)
33
+ warn "Using `listen:` option is deprecated, please pass as the first argument."
34
+ args.unshift(listen)
35
+ end
36
+
37
+ server = server_class.new(*args, **options, &block)
33
38
 
34
39
  server.run
35
40
  end
@@ -100,8 +100,8 @@ module RubyDNS
100
100
  # end
101
101
  # end
102
102
  #
103
- def initialize(options = {}, &block)
104
- super(options)
103
+ def initialize(*args, &block)
104
+ super(*args)
105
105
 
106
106
  @events = {}
107
107
  @rules = []
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module RubyDNS
22
- VERSION = '2.0.0-rc2'
22
+ VERSION = '2.0.0'
23
23
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.required_ruby_version = '>= 2.2.6'
32
32
 
33
- spec.add_dependency("async-dns", "~> 0.12")
33
+ spec.add_dependency("async-dns", "~> 1.0")
34
34
  spec.add_development_dependency("async-rspec", "~> 1.0")
35
35
 
36
36
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -38,7 +38,7 @@ class BasicTestServer < Process::Daemon
38
38
 
39
39
  def startup
40
40
  reactor.run do
41
- RubyDNS::run_server(listen: SERVER_PORTS) do
41
+ RubyDNS::run_server(SERVER_PORTS) do
42
42
  match("test.local", IN::A) do |transaction|
43
43
  transaction.respond!("192.168.1.1")
44
44
  end
@@ -38,7 +38,7 @@ module RubyDNS::InjectedSupervisorSpec
38
38
 
39
39
  let(:server) do
40
40
  # Start the RubyDNS server
41
- RubyDNS::run_server(listen: SERVER_PORTS, server_class: TestServer) do
41
+ RubyDNS::run_server(SERVER_PORTS, server_class: TestServer) do
42
42
  match("test_message", IN::TXT) do |transaction|
43
43
  transaction.respond!(*test_message.chunked)
44
44
  end
@@ -31,7 +31,7 @@ module RubyDNS::PassthroughSpec
31
31
  include_context Async::RSpec::Reactor
32
32
 
33
33
  def run_server
34
- task = RubyDNS::run_server(:listen => SERVER_PORTS) do
34
+ task = RubyDNS::run_server(listen: SERVER_PORTS) do
35
35
  resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
36
36
 
37
37
  match(/.*\.com/, IN::A) do |transaction|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydns
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.rc2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-25 00:00:00.000000000 Z
11
+ date: 2017-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-dns
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.12'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.12'
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: async-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -140,9 +140,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: 2.2.6
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 1.3.1
145
+ version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
148
  rubygems_version: 2.6.10