rubydns 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/rubydns.rb CHANGED
@@ -63,7 +63,7 @@ module RubyDNS
63
63
  #
64
64
  def self.run_server (options = {}, &block)
65
65
  server = RubyDNS::Server.new(&block)
66
- server.logger.info "Starting server..."
66
+ server.logger.info "Starting RubyDNS server (v#{RubyDNS::VERSION::STRING})..."
67
67
 
68
68
  options[:listen] ||= [[:udp, "0.0.0.0", 53], [:tcp, "0.0.0.0", 53]]
69
69
 
@@ -199,7 +199,6 @@ module RubyDNS
199
199
  true
200
200
  end
201
201
 
202
- protected
203
202
  def append_question!
204
203
  if @answer.question.size == 0
205
204
  @answer.add_question(@question, @resource_class) unless @question_appended
@@ -22,7 +22,7 @@ module RubyDNS
22
22
  module VERSION #:nodoc:
23
23
  MAJOR = 0
24
24
  MINOR = 4
25
- TINY = 0
25
+ TINY = 1
26
26
 
27
27
  STRING = [MAJOR, MINOR, TINY].join('.')
28
28
  end
data/test/example1.rb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby1.9
2
2
 
3
3
  # Copyright (c) 2009, 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
4
4
  #
@@ -31,6 +31,18 @@ Name = Resolv::DNS::Name
31
31
  IN = Resolv::DNS::Resource::IN
32
32
 
33
33
  RubyDNS::run_server do
34
+ # % dig +nocmd +noall +answer @localhost ANY dev.mydomain.org
35
+ # dev.mydomain.org. 16000 IN A 10.0.0.80
36
+ # dev.mydomain.org. 16000 IN MX 10 mail.mydomain.org.
37
+ match(/dev.mydomain.org/, IN::ANY) do |match_data, transaction|
38
+ transaction.append_question!
39
+
40
+ [IN::A, IN::CNAME, IN::MX].each do |resource_class|
41
+ logger.debug "Appending query for #{resource_class}..."
42
+ transaction.append_query!(transaction.name, resource_class)
43
+ end
44
+ end
45
+
34
46
  # For this exact address record, return an IP address
35
47
  match("dev.mydomain.org", IN::A) do |transaction|
36
48
  transaction.respond!("10.0.0.80")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-11 00:00:00.000000000 Z
12
+ date: 2012-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rexec