rubydns 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWFmMGQwYzlmMGFkMjczY2VlNzExMjdmMDI3NDZiNTFjMTc2Nzk4NQ==
4
+ MmFiYWE2NWRkNDFhZTZkZTkwMTYyNDkyNmQ2Y2QyY2M5ZDJjMWUyMg==
5
5
  data.tar.gz: !binary |-
6
- MjljNzMxODYwNmZlNTdmNzBjMjFkNjRmYjYxZDIxZWRlZmIzYTQ0OA==
6
+ MDY4MzQ4OWUyMDY4MzM1Mzc2YTMwMjU5NDc0MzA5ZWEzZTI0Zjg4Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MWZiMTBlY2YxYjdiYzIzMDU0OTBhMzBkN2RiZjY4OWZlNGFjNzM2ZGUxZTUx
10
- NDE0MzdiMjFiZTg5OTM2NmVhNjcwMmY0NjE1MzNlN2JmZWM4MTIxMjQwYjk2
11
- MjVjOTViMDNkYzQ0NTBlZTdlODIzM2IyZDg3NjEwZjNhMDBlNTM=
9
+ MjIwMGUyZDk1ZDIwODhmZTE3ZmRiZDRkNGUwZjVmYjcwODU3OGQwZjQ3NTZj
10
+ NTQyOTAwOGJkZTA5ZTcxNWViNzU2OGQ4MDlmODE4YzQ4NTAyNzJlNDhiMTFi
11
+ ZDhmODEwODc0MTFmYTMxOWU5NzM3NDQwNjA1NmI5Y2QwYjU1ZDU=
12
12
  data.tar.gz: !binary |-
13
- NzJiNGE4YjhjY2Q4MjQ3MWU0ODgwOTk4NWJlM2YwYmQ4OWZlNDdkYTIxOTU2
14
- Y2FjN2UwZjZhNGYzMzc5NDY2NDYyNDFmMmVkMDZkYjg4Zjk2MWQyZjA3YzEw
15
- NTRlYzZjM2JkYTFjNzUyZDYyNGMwODUxZDdiNjc5NTllZjhmODM=
13
+ YzFkYzVhODM0YzU3N2E5N2RjYzRhNzNlZWRhMzE1M2QxMTIxYjA4MzQ1YjRk
14
+ NGJlYTM5Y2YwNTYwN2Y5ZmY3M2RlNTY4MmU1ODA1NzZlMTA4ZTgzY2IxMzU2
15
+ NTJjMTdjNGM5MTc1YzMzZDAyM2IyMzcyYWVjZTg4Y2VlYzU3NmI=
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.8.7"
4
3
  - "1.9.2"
5
4
  - "1.9.3"
6
- - rbx-18mode
5
+ - "2.0"
7
6
  - rbx-19mode
data/README.md CHANGED
@@ -27,6 +27,7 @@ Or install it yourself as:
27
27
  ## Usage
28
28
 
29
29
  This is copied from `test/examples/test-dns-2.rb`. It has been simplified slightly.
30
+
30
31
  ```ruby
31
32
  #!/usr/bin/env ruby
32
33
  require 'rubydns'
@@ -56,7 +57,9 @@ def self.run
56
57
  end
57
58
  run
58
59
  ```
60
+
59
61
  Start the server using `rvmsudo ./test.rb`. You can then test it using dig:
62
+
60
63
  ```
61
64
  $ dig @localhost test1.mydomain.org
62
65
  $ dig @localhost dev.mydomain.org
@@ -69,6 +72,8 @@ $ dig @localhost google.com
69
72
 
70
73
  The order of arguments to pattern based rules has changed. For regular expression based rules, the arguments are now ordered `|transaction, match_data|`. The main reason for this change was that in many cases match_data is not important and can thus be ignored, e.g. `|transaction|`.
71
74
 
75
+ Going forward, Ruby 1.8.x is no longer supported.
76
+
72
77
  ### Migrating from RubyDNS 0.3.x to 0.4.x ###
73
78
 
74
79
  Due to changes in `resolv.rb`, superficial parts of RubyDNS have changed. Rather than using `:A` to specify A-records, one must now use the class name.
@@ -216,20 +216,22 @@ module RubyDNS
216
216
  @buffer ||= BinaryStringIO.new
217
217
  @buffer.write(data)
218
218
 
219
- if @length == nil
220
- if @buffer.size > 2
221
- @length = @buffer.string.byteslice(0, 2).unpack('n')[0]
222
- end
219
+ # If we've received enough data and we haven't figured out the length yet...
220
+ if @length == nil and @buffer.size > 2
221
+ # Extract the length from the buffer:
222
+ @length = @buffer.string.byteslice(0, 2).unpack('n')[0]
223
223
  end
224
224
 
225
- # If we have received more data than expected, should this be an error?
226
- if @buffer.size >= (@length + 2)
225
+ # If we know what the length is, and we've got that much data, we can decode the message:
226
+ if @length != nil and @buffer.size >= (@length + 2)
227
227
  data = @buffer.string.byteslice(2, @length)
228
228
 
229
229
  message = RubyDNS::decode_message(data)
230
230
 
231
231
  @request.process_response!(message)
232
232
  end
233
+
234
+ # If we have received more data than expected, should this be an error?
233
235
  rescue Resolv::DNS::DecodeError => error
234
236
  @request.process_response!(error)
235
237
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module RubyDNS
22
- VERSION = "0.6.0"
22
+ VERSION = "0.6.1"
23
23
  end
data/rubydns.gemspec CHANGED
@@ -9,23 +9,25 @@ Gem::Specification.new do |gem|
9
9
  gem.authors = ["Samuel Williams"]
10
10
  gem.email = ["samuel.williams@oriontransfer.co.nz"]
11
11
  gem.description = <<-EOF
12
- RubyDNS is a high-performance DNS server which can be easily integrated into
13
- other projects or used as a stand-alone daemon (via RExec). By default it uses
14
- rule-based pattern matching. Results can be hard-coded, computed, fetched from
15
- a remote DNS server or fetched from a local cache, depending on requirements.
12
+ RubyDNS is a high-performance DNS server which can be easily integrated into
13
+ other projects or used as a stand-alone daemon (via RExec). By default it uses
14
+ rule-based pattern matching. Results can be hard-coded, computed, fetched from
15
+ a remote DNS server or fetched from a local cache, depending on requirements.
16
16
 
17
- In addition, RubyDNS includes a high-performance asynchronous DNS resolver
18
- built on top of EventMachine. This module can be used by itself in client
19
- applications without using the full RubyDNS server stack.
17
+ In addition, RubyDNS includes a high-performance asynchronous DNS resolver
18
+ built on top of EventMachine. This module can be used by itself in client
19
+ applications without using the full RubyDNS server stack.
20
20
  EOF
21
21
  gem.summary = "An easy to use DNS server and resolver for Ruby."
22
- gem.homepage = "https://github.com/ioquatix/rubydns"
22
+ gem.homepage = "http://www.codeotaku.com/projects/rubydns"
23
23
 
24
24
  gem.files = `git ls-files`.split($/)
25
25
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
26
26
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
27
27
  gem.require_paths = ["lib"]
28
28
 
29
+ gem.required_ruby_version = '>= 1.9.3'
30
+
29
31
  gem.add_dependency("rexec", "~> 1.5.1")
30
32
  gem.add_dependency("eventmachine", "~> 1.0.0")
31
33
 
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.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-14 00:00:00.000000000 Z
11
+ date: 2013-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rexec
@@ -38,12 +38,12 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
- description: ! "\tRubyDNS is a high-performance DNS server which can be easily integrated
42
- into\n\tother projects or used as a stand-alone daemon (via RExec). By default it
43
- uses\n\trule-based pattern matching. Results can be hard-coded, computed, fetched
44
- from\n\ta remote DNS server or fetched from a local cache, depending on requirements.\n\n\tIn
45
- addition, RubyDNS includes a high-performance asynchronous DNS resolver\n\tbuilt
46
- on top of EventMachine. This module can be used by itself in client\n\tapplications
41
+ description: ! "\t\tRubyDNS is a high-performance DNS server which can be easily integrated
42
+ into\n\t\tother projects or used as a stand-alone daemon (via RExec). By default
43
+ it uses\n\t\trule-based pattern matching. Results can be hard-coded, computed, fetched
44
+ from\n\t\ta remote DNS server or fetched from a local cache, depending on requirements.\n\n\t\tIn
45
+ addition, RubyDNS includes a high-performance asynchronous DNS resolver\n\t\tbuilt
46
+ on top of EventMachine. This module can be used by itself in client\n\t\tapplications
47
47
  without using the full RubyDNS server stack.\n"
48
48
  email:
49
49
  - samuel.williams@oriontransfer.co.nz
@@ -93,7 +93,7 @@ files:
93
93
  - test/test_slow_server.rb
94
94
  - test/test_system.rb
95
95
  - test/test_truncation.rb
96
- homepage: https://github.com/ioquatix/rubydns
96
+ homepage: http://www.codeotaku.com/projects/rubydns
97
97
  licenses: []
98
98
  metadata: {}
99
99
  post_install_message:
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - ! '>='
106
106
  - !ruby/object:Gem::Version
107
- version: '0'
107
+ version: 1.9.3
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ! '>='