latte 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/devdnsd +21 -0
  2. data/lib/latte.rb +1 -1
  3. data/lib/latte/version.rb +1 -1
  4. metadata +34 -13
@@ -0,0 +1,21 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'latte'
4
+
5
+ remote_resolver = Net::DNS::Resolver.new :nameservers => %w(8.8.8.8 8.8.4.4)
6
+
7
+ resolver = proc { |q,r|
8
+ if q.qname =~ /\.dev\.$/
9
+ r.add_answer "#{q.qname} 300 #{q.qclass} #{q.qtype} 127.0.0.1"
10
+ else
11
+ packet = remote_resolver.query q.qname.to_s, q.qtype.to_s, q.qclass.to_s
12
+ packet.answer.each do |rr|
13
+ r.add_answer rr.to_s
14
+ end
15
+ end
16
+ }
17
+
18
+ logger = Logger.new STDOUT
19
+ logger.level = Logger::DEBUG
20
+ server = Latte::Server.new resolver, logger
21
+ server.run
@@ -2,7 +2,7 @@ require 'null_logger'
2
2
  require 'socket'
3
3
  require 'bindata'
4
4
  require 'pethau'
5
- require 'net/dns/packet'
5
+ require 'net/dns'
6
6
 
7
7
  class Object
8
8
  include Pethau::InitializeWith
@@ -1,3 +1,3 @@
1
1
  module Latte
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-30 00:00:00.000000000Z
12
+ date: 2012-08-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pethau
16
- requirement: &70162529756660 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 0.0.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70162529756660
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.0.2
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: net-dns
27
- requirement: &70162529756240 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70162529756240
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: null_logger
38
- requirement: &70162529755780 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70162529755780
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: bindata
49
- requirement: &70162529755360 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,20 +69,26 @@ dependencies:
54
69
  version: '0'
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *70162529755360
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  description: Talks DNS and passes queries back to a query resolver build by you that
59
79
  just talks Ruby
60
80
  email:
61
81
  - craig@barkingiguana.com
62
- executables: []
82
+ executables:
83
+ - devdnsd
63
84
  extensions: []
64
85
  extra_rdoc_files: []
65
86
  files:
66
87
  - .gitignore
67
88
  - Gemfile
68
- - Gemfile.lock
69
89
  - README.md
70
90
  - Rakefile
91
+ - bin/devdnsd
71
92
  - latte.gemspec
72
93
  - lib/latte.rb
73
94
  - lib/latte/address.rb
@@ -96,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
117
  version: '0'
97
118
  requirements: []
98
119
  rubyforge_project: latte
99
- rubygems_version: 1.8.10
120
+ rubygems_version: 1.8.24
100
121
  signing_key:
101
122
  specification_version: 3
102
123
  summary: A DNS framework with configurable query resolver