rubydns 0.9.2 → 0.9.3
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.
- checksums.yaml +4 -4
- data/lib/rubydns/transaction.rb +3 -1
- data/lib/rubydns/version.rb +1 -1
- data/spec/rubydns/transaction_spec.rb +24 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b96c1f2e9752973d51217be442205e95defe642
|
4
|
+
data.tar.gz: 0200c178cbbffe9429b7ec0997f0bfc407a00868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 007c979c79a868f387b0ed0168649c9a8ff7b188c7b9a5e8c63e959c761dfa15b5ce517fac63ecdf7070e18d316f3a6ac48913cf91ac48267a49e4aee002c26a
|
7
|
+
data.tar.gz: 20287eb57c761aebb9742c9ac563725a5b8dd3a5adb3c4741ca9441d3eceaee5a4422f4e3e70a1028a4c91c7a2d6562d0c325b6f2935c21dfead3a7f1ac82da8
|
data/lib/rubydns/transaction.rb
CHANGED
@@ -73,7 +73,7 @@ module RubyDNS
|
|
73
73
|
|
74
74
|
# Use the given resolver to respond to the question. Uses `passthrough` to do the lookup and merges the result.
|
75
75
|
#
|
76
|
-
# If a block is supplied, this function yields with the `
|
76
|
+
# If a block is supplied, this function yields with the `response` message if successful. This could be used, for example, to update a cache or modify the reply.
|
77
77
|
#
|
78
78
|
# If recursion is not requested, the result is `fail!(:Refused)`. This check is ignored if an explicit `options[:name]` or `options[:force]` is given.
|
79
79
|
#
|
@@ -83,6 +83,8 @@ module RubyDNS
|
|
83
83
|
response = passthrough(resolver, options)
|
84
84
|
|
85
85
|
if response
|
86
|
+
yield response if block_given?
|
87
|
+
|
86
88
|
# Recursion is available and is being used:
|
87
89
|
# See issue #26 for more details.
|
88
90
|
@response.ra = 1
|
data/lib/rubydns/version.rb
CHANGED
@@ -53,6 +53,30 @@ module RubyDNS::TransactionSpec
|
|
53
53
|
expect(transaction.response.answer.size).to be > 0
|
54
54
|
end
|
55
55
|
|
56
|
+
it "should return a response on passthrough" do
|
57
|
+
transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
|
58
|
+
|
59
|
+
expect(transaction.response.answer.size).to be 0
|
60
|
+
|
61
|
+
response = transaction.passthrough(resolver)
|
62
|
+
|
63
|
+
expect(response.answer.length).to be > 0
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should call the block with the response when invoking passthrough!" do
|
67
|
+
transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
|
68
|
+
|
69
|
+
expect(transaction.response.answer.size).to be 0
|
70
|
+
|
71
|
+
passthrough_response = nil
|
72
|
+
|
73
|
+
transaction.passthrough!(resolver) do |response|
|
74
|
+
passthrough_response = response
|
75
|
+
end
|
76
|
+
|
77
|
+
expect(passthrough_response.answer.length).to be > 0
|
78
|
+
end
|
79
|
+
|
56
80
|
it "should fail the request" do
|
57
81
|
transaction = RubyDNS::Transaction.new(server, query, question, IN::A, response)
|
58
82
|
|
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: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|