rubydns 0.9.2 → 0.9.3

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: 898751427b20f0b4ca38ef3847c63846cb0f31bb
4
- data.tar.gz: 87e103c621007b21ac049a3e00ebed1ea03b066b
3
+ metadata.gz: 1b96c1f2e9752973d51217be442205e95defe642
4
+ data.tar.gz: 0200c178cbbffe9429b7ec0997f0bfc407a00868
5
5
  SHA512:
6
- metadata.gz: 0d7600616e59ed6bf93c7da9b892d2dc71e181512ef1f85721057214bf86eb28c36b614013cc947685111a136b6fb57279411ed3ffe8a69bb1757782f34f9f5a
7
- data.tar.gz: 16a27d29545fd438089be5f31bc5db1395038e5ddf06edc7913926ab5430f5c9f4f067b6485c70a4ea2cb5058766c0ebbe6a2ae2050bf3dda5d78ab9d5c477fb
6
+ metadata.gz: 007c979c79a868f387b0ed0168649c9a8ff7b188c7b9a5e8c63e959c761dfa15b5ce517fac63ecdf7070e18d316f3a6ac48913cf91ac48267a49e4aee002c26a
7
+ data.tar.gz: 20287eb57c761aebb9742c9ac563725a5b8dd3a5adb3c4741ca9441d3eceaee5a4422f4e3e70a1028a4c91c7a2d6562d0c325b6f2935c21dfead3a7f1ac82da8
@@ -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 `reply` and `reply_name` if successful. This could be used, for example, to update a cache or modify the reply.
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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module RubyDNS
22
- VERSION = "0.9.2"
22
+ VERSION = "0.9.3"
23
23
  end
@@ -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.2
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-16 00:00:00.000000000 Z
11
+ date: 2014-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid