devdnsd 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - jruby
6
+ - rbx-18mode
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devdnsd (1.0.0)
4
+ devdnsd (1.0.1)
5
5
  cowtech-extensions (~> 2.1.0)
6
6
  gli (~> 1.6.0)
7
7
  rainbow (~> 1.1.0)
@@ -32,7 +32,6 @@ GEM
32
32
  cowtech-extensions (2.1.3)
33
33
  actionpack (~> 3.0)
34
34
  tzinfo (~> 0.3.33)
35
- diff-lcs (1.1.3)
36
35
  erubis (2.7.0)
37
36
  eventmachine (0.12.10)
38
37
  github-markup (0.7.2)
@@ -55,14 +54,7 @@ GEM
55
54
  rainbow (1.1.4)
56
55
  redcarpet (2.1.1)
57
56
  rexec (1.4.1)
58
- rspec (2.11.0)
59
- rspec-core (~> 2.11.0)
60
- rspec-expectations (~> 2.11.0)
61
- rspec-mocks (~> 2.11.0)
62
- rspec-core (2.11.0)
63
- rspec-expectations (2.11.1)
64
- diff-lcs (~> 1.1.3)
65
- rspec-mocks (2.11.1)
57
+ rspec (0.9.4)
66
58
  rubydns (0.4.1)
67
59
  eventmachine
68
60
  rexec
@@ -86,8 +78,8 @@ DEPENDENCIES
86
78
  devdnsd!
87
79
  github-markup (~> 0.7.0)
88
80
  net-dns (~> 0.7.0)
89
- pry (~> 0.9.9)
81
+ pry (~> 0.9.10)
90
82
  redcarpet (~> 2.1.0)
91
- rspec (~> 2.11.0)
83
+ rspec (~> 0.9.0)
92
84
  simplecov (~> 0.6.0)
93
85
  yard (~> 0.8.0)
data/devdnsd.gemspec CHANGED
@@ -29,8 +29,9 @@ Gem::Specification.new do |gem|
29
29
  gem.add_dependency("rainbow", "~> 1.1.0")
30
30
 
31
31
  gem.add_development_dependency("rspec", "~> 2.11.0")
32
+ gem.add_development_dependency("rspec", "~> 0.9.0")
32
33
  gem.add_development_dependency("simplecov", "~> 0.6.0")
33
- gem.add_development_dependency("pry", "~> 0.9.9")
34
+ gem.add_development_dependency("pry", "~> 0.9.10")
34
35
  gem.add_development_dependency("net-dns", "~> 0.7.0")
35
36
  gem.add_development_dependency("yard", "~> 0.8.0")
36
37
  gem.add_development_dependency("redcarpet", "~> 2.1.0")
@@ -154,7 +154,7 @@ module DevDNSd
154
154
  #
155
155
  # @param rule [Rule] The rule to process.
156
156
  # @param type [Class] The type of request.
157
- # @param match_or_transaction [MatchData|nil] If the rule pattern was a Regexp, then this holds the match data, otherwise `nil` is passed.
157
+ # @param match_data [MatchData|nil] If the rule pattern was a Regexp, then this holds the match data, otherwise `nil` is passed.
158
158
  # @param transaction [Transaction] The current DNS transaction (http://rubydoc.info/gems/rubydns/RubyDNS/Transaction).
159
159
  # @return A reply for the request if matched, otherwise `false` or `nil`.
160
160
  def process_rule(rule, type, match_data, transaction)
@@ -363,4 +363,4 @@ module DevDNSd
363
363
  EventMachine.stop
364
364
  end
365
365
  end
366
- end
366
+ end
data/lib/devdnsd/rule.rb CHANGED
@@ -73,7 +73,7 @@ module DevDNSd
73
73
 
74
74
  # Matches a hostname to the rule.
75
75
  #
76
- # @param [String] The hostname to match.
76
+ # @param hostname [String] The hostname to match.
77
77
  # @return [MatchData|Boolean|Nil] Return `true` or MatchData (if the pattern is a regexp) if the rule matches, `false` or `nil` otherwise.
78
78
  def match_host(hostname)
79
79
  self.is_regexp? ? self.match.match(hostname) : (self.match == hostname)
@@ -127,4 +127,4 @@ module DevDNSd
127
127
  end
128
128
  end
129
129
  end
130
- end
130
+ end
@@ -5,8 +5,9 @@
5
5
  #
6
6
 
7
7
  module DevDNSd
8
- # The current version of DevDNSd.
9
- # For version, semantic version is used. See: http://semver.org/
8
+ # The current version of DevDNSd, according to semantic versioning.
9
+ #
10
+ # @see http://semver.org
10
11
  module Version
11
12
  # The major version.
12
13
  MAJOR = 1
@@ -15,7 +16,7 @@ module DevDNSd
15
16
  MINOR = 0
16
17
 
17
18
  # The patch version.
18
- PATCH = 0
19
+ PATCH = 1
19
20
 
20
21
  # The current version number of DevDNSd.
21
22
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
@@ -32,7 +32,7 @@ describe DevDNSd::Application do
32
32
  end
33
33
  end
34
34
 
35
- describe "#run" do
35
+ describe ".run" do
36
36
  it "should run the server" do
37
37
  application.should_receive(:perform_server)
38
38
 
@@ -11,7 +11,7 @@ describe DevDNSd::Logger do
11
11
  Sickill::Rainbow.enabled = false
12
12
  end
13
13
 
14
- describe "#create" do
14
+ describe ".create" do
15
15
  it("should create a new default logger") do
16
16
  logger = DevDNSd::Logger.create
17
17
  logger.device.should == DevDNSd::Logger.default_file
@@ -35,7 +35,7 @@ describe DevDNSd::Logger do
35
35
  end
36
36
  end
37
37
 
38
- describe "#default_formatter" do
38
+ describe ".default_formatter" do
39
39
  let(:output) { StringIO.new }
40
40
  let(:logger) { DevDNSd::Logger.create(output, Logger::DEBUG) }
41
41
 
@@ -74,13 +74,13 @@ describe DevDNSd::Logger do
74
74
  end
75
75
  end
76
76
 
77
- describe "#get_real_file" do
77
+ describe ".get_real_file" do
78
78
  it("should return the standard ouput") do DevDNSd::Logger.get_real_file("STDOUT").should == $stdout end
79
79
  it("should return the standard error") do DevDNSd::Logger.get_real_file("STDERR").should == $stderr end
80
80
  it("should return the file") do DevDNSd::Logger.get_real_file("/dev/null").should == "/dev/null" end
81
81
  end
82
82
 
83
- describe "#default_file" do
83
+ describe ".default_file" do
84
84
  it("should return the standard output") do DevDNSd::Logger.default_file.should == $stdout end
85
85
  end
86
86
  end
@@ -58,7 +58,7 @@ describe DevDNSd::Rule do
58
58
  end
59
59
  end
60
60
 
61
- describe "#create" do
61
+ describe "::create" do
62
62
  it("should not allow rules without sufficient arguments") do
63
63
  expect{ DevDNSd::Rule.create("RULE") }.to raise_error(DevDNSd::Errors::InvalidRule)
64
64
  expect{ DevDNSd::Rule.create("RULE", "REPLY", "TYPE", "ARG") }.to raise_error(DevDNSd::Errors::InvalidRule)
@@ -97,14 +97,14 @@ describe DevDNSd::Rule do
97
97
  it("should fail for a invalid class") do expect { DevDNSd::Rule.create("MATCH", "REPLY", :INVALID).resource_class }.to raise_error(DevDNSd::Errors::InvalidRule) end
98
98
  end
99
99
 
100
- describe "#resource_class_to_symbol" do
100
+ describe "::resource_class_to_symbol" do
101
101
  it("should convert a class a symbol") do
102
102
  DevDNSd::Rule.resource_class_to_symbol(Resolv::DNS::Resource::IN::A).should == :A
103
103
  DevDNSd::Rule.resource_class_to_symbol(Resolv).should == :Resolv
104
104
  end
105
105
  end
106
106
 
107
- describe "#symbol_to_resource_class" do
107
+ describe "::symbol_to_resource_class" do
108
108
  it("should convert a symbol to a resource class") do DevDNSd::Rule.symbol_to_resource_class(:A).should == Resolv::DNS::Resource::IN::A end
109
109
  it("should fail for a invalid class") do expect { DevDNSd::Rule.symbol_to_resource_class(:Invalid) }.to raise_error(DevDNSd::Errors::InvalidRule) end
110
110
  end
metadata CHANGED
@@ -1,218 +1,243 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: devdnsd
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 1
10
+ version: 1.0.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Shogun
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-07-16 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-07-24 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: rubydns
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 0.4.0
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
- requirements:
25
+ requirements:
27
26
  - - ~>
28
- - !ruby/object:Gem::Version
27
+ - !ruby/object:Gem::Version
28
+ hash: 15
29
+ segments:
30
+ - 0
31
+ - 4
32
+ - 0
29
33
  version: 0.4.0
30
- - !ruby/object:Gem::Dependency
31
- name: cowtech-extensions
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 2.1.0
38
34
  type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: cowtech-extensions
39
38
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
41
+ requirements:
43
42
  - - ~>
44
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
44
+ hash: 11
45
+ segments:
46
+ - 2
47
+ - 1
48
+ - 0
45
49
  version: 2.1.0
46
- - !ruby/object:Gem::Dependency
47
- name: gli
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 1.6.0
54
50
  type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: gli
55
54
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
55
+ requirement: &id003 !ruby/object:Gem::Requirement
57
56
  none: false
58
- requirements:
57
+ requirements:
59
58
  - - ~>
60
- - !ruby/object:Gem::Version
59
+ - !ruby/object:Gem::Version
60
+ hash: 15
61
+ segments:
62
+ - 1
63
+ - 6
64
+ - 0
61
65
  version: 1.6.0
62
- - !ruby/object:Gem::Dependency
63
- name: rexec
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: 1.4.1
70
66
  type: :runtime
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
69
+ name: rexec
71
70
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
71
+ requirement: &id004 !ruby/object:Gem::Requirement
73
72
  none: false
74
- requirements:
73
+ requirements:
75
74
  - - ~>
76
- - !ruby/object:Gem::Version
75
+ - !ruby/object:Gem::Version
76
+ hash: 5
77
+ segments:
78
+ - 1
79
+ - 4
80
+ - 1
77
81
  version: 1.4.1
78
- - !ruby/object:Gem::Dependency
79
- name: rainbow
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: 1.1.0
86
82
  type: :runtime
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
85
+ name: rainbow
87
86
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
87
+ requirement: &id005 !ruby/object:Gem::Requirement
89
88
  none: false
90
- requirements:
89
+ requirements:
91
90
  - - ~>
92
- - !ruby/object:Gem::Version
91
+ - !ruby/object:Gem::Version
92
+ hash: 19
93
+ segments:
94
+ - 1
95
+ - 1
96
+ - 0
93
97
  version: 1.1.0
94
- - !ruby/object:Gem::Dependency
98
+ type: :runtime
99
+ version_requirements: *id005
100
+ - !ruby/object:Gem::Dependency
95
101
  name: rspec
96
- requirement: !ruby/object:Gem::Requirement
102
+ prerelease: false
103
+ requirement: &id006 !ruby/object:Gem::Requirement
97
104
  none: false
98
- requirements:
105
+ requirements:
99
106
  - - ~>
100
- - !ruby/object:Gem::Version
107
+ - !ruby/object:Gem::Version
108
+ hash: 35
109
+ segments:
110
+ - 2
111
+ - 11
112
+ - 0
101
113
  version: 2.11.0
102
114
  type: :development
115
+ version_requirements: *id006
116
+ - !ruby/object:Gem::Dependency
117
+ name: rspec
103
118
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ~>
108
- - !ruby/object:Gem::Version
109
- version: 2.11.0
110
- - !ruby/object:Gem::Dependency
111
- name: simplecov
112
- requirement: !ruby/object:Gem::Requirement
119
+ requirement: &id007 !ruby/object:Gem::Requirement
113
120
  none: false
114
- requirements:
121
+ requirements:
115
122
  - - ~>
116
- - !ruby/object:Gem::Version
117
- version: 0.6.0
123
+ - !ruby/object:Gem::Version
124
+ hash: 59
125
+ segments:
126
+ - 0
127
+ - 9
128
+ - 0
129
+ version: 0.9.0
118
130
  type: :development
131
+ version_requirements: *id007
132
+ - !ruby/object:Gem::Dependency
133
+ name: simplecov
119
134
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
135
+ requirement: &id008 !ruby/object:Gem::Requirement
121
136
  none: false
122
- requirements:
137
+ requirements:
123
138
  - - ~>
124
- - !ruby/object:Gem::Version
139
+ - !ruby/object:Gem::Version
140
+ hash: 7
141
+ segments:
142
+ - 0
143
+ - 6
144
+ - 0
125
145
  version: 0.6.0
126
- - !ruby/object:Gem::Dependency
127
- name: pry
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ~>
132
- - !ruby/object:Gem::Version
133
- version: 0.9.9
134
146
  type: :development
147
+ version_requirements: *id008
148
+ - !ruby/object:Gem::Dependency
149
+ name: pry
135
150
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
151
+ requirement: &id009 !ruby/object:Gem::Requirement
137
152
  none: false
138
- requirements:
153
+ requirements:
139
154
  - - ~>
140
- - !ruby/object:Gem::Version
141
- version: 0.9.9
142
- - !ruby/object:Gem::Dependency
143
- name: net-dns
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ~>
148
- - !ruby/object:Gem::Version
149
- version: 0.7.0
155
+ - !ruby/object:Gem::Version
156
+ hash: 47
157
+ segments:
158
+ - 0
159
+ - 9
160
+ - 10
161
+ version: 0.9.10
150
162
  type: :development
163
+ version_requirements: *id009
164
+ - !ruby/object:Gem::Dependency
165
+ name: net-dns
151
166
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
167
+ requirement: &id010 !ruby/object:Gem::Requirement
153
168
  none: false
154
- requirements:
169
+ requirements:
155
170
  - - ~>
156
- - !ruby/object:Gem::Version
171
+ - !ruby/object:Gem::Version
172
+ hash: 3
173
+ segments:
174
+ - 0
175
+ - 7
176
+ - 0
157
177
  version: 0.7.0
158
- - !ruby/object:Gem::Dependency
159
- name: yard
160
- requirement: !ruby/object:Gem::Requirement
161
- none: false
162
- requirements:
163
- - - ~>
164
- - !ruby/object:Gem::Version
165
- version: 0.8.0
166
178
  type: :development
179
+ version_requirements: *id010
180
+ - !ruby/object:Gem::Dependency
181
+ name: yard
167
182
  prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
183
+ requirement: &id011 !ruby/object:Gem::Requirement
169
184
  none: false
170
- requirements:
185
+ requirements:
171
186
  - - ~>
172
- - !ruby/object:Gem::Version
187
+ - !ruby/object:Gem::Version
188
+ hash: 63
189
+ segments:
190
+ - 0
191
+ - 8
192
+ - 0
173
193
  version: 0.8.0
174
- - !ruby/object:Gem::Dependency
175
- name: redcarpet
176
- requirement: !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ~>
180
- - !ruby/object:Gem::Version
181
- version: 2.1.0
182
194
  type: :development
195
+ version_requirements: *id011
196
+ - !ruby/object:Gem::Dependency
197
+ name: redcarpet
183
198
  prerelease: false
184
- version_requirements: !ruby/object:Gem::Requirement
199
+ requirement: &id012 !ruby/object:Gem::Requirement
185
200
  none: false
186
- requirements:
201
+ requirements:
187
202
  - - ~>
188
- - !ruby/object:Gem::Version
203
+ - !ruby/object:Gem::Version
204
+ hash: 11
205
+ segments:
206
+ - 2
207
+ - 1
208
+ - 0
189
209
  version: 2.1.0
190
- - !ruby/object:Gem::Dependency
191
- name: github-markup
192
- requirement: !ruby/object:Gem::Requirement
193
- none: false
194
- requirements:
195
- - - ~>
196
- - !ruby/object:Gem::Version
197
- version: 0.7.0
198
210
  type: :development
211
+ version_requirements: *id012
212
+ - !ruby/object:Gem::Dependency
213
+ name: github-markup
199
214
  prerelease: false
200
- version_requirements: !ruby/object:Gem::Requirement
215
+ requirement: &id013 !ruby/object:Gem::Requirement
201
216
  none: false
202
- requirements:
217
+ requirements:
203
218
  - - ~>
204
- - !ruby/object:Gem::Version
219
+ - !ruby/object:Gem::Version
220
+ hash: 3
221
+ segments:
222
+ - 0
223
+ - 7
224
+ - 0
205
225
  version: 0.7.0
226
+ type: :development
227
+ version_requirements: *id013
206
228
  description: A small DNS server to enable local domain resolution.
207
- email:
229
+ email:
208
230
  - shogun_panda@me.com
209
- executables:
231
+ executables:
210
232
  - devdnsd
211
233
  extensions: []
234
+
212
235
  extra_rdoc_files: []
213
- files:
236
+
237
+ files:
214
238
  - .DS_Store
215
239
  - .gitignore
240
+ - .travis.yml
216
241
  - .yardopts
217
242
  - Gemfile
218
243
  - Gemfile.lock
@@ -237,29 +262,38 @@ files:
237
262
  - utils/tester.rb
238
263
  homepage: http://github.com/ShogunPanda/devdnsd
239
264
  licenses: []
265
+
240
266
  post_install_message:
241
267
  rdoc_options: []
242
- require_paths:
268
+
269
+ require_paths:
243
270
  - lib
244
- required_ruby_version: !ruby/object:Gem::Requirement
271
+ required_ruby_version: !ruby/object:Gem::Requirement
245
272
  none: false
246
- requirements:
247
- - - ! '>='
248
- - !ruby/object:Gem::Version
249
- version: '0'
250
- required_rubygems_version: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - ">="
275
+ - !ruby/object:Gem::Version
276
+ hash: 3
277
+ segments:
278
+ - 0
279
+ version: "0"
280
+ required_rubygems_version: !ruby/object:Gem::Requirement
251
281
  none: false
252
- requirements:
253
- - - ! '>='
254
- - !ruby/object:Gem::Version
255
- version: '0'
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ hash: 3
286
+ segments:
287
+ - 0
288
+ version: "0"
256
289
  requirements: []
290
+
257
291
  rubyforge_project: devdnsd
258
292
  rubygems_version: 1.8.24
259
293
  signing_key:
260
294
  specification_version: 3
261
295
  summary: A small DNS server to enable local domain resolution.
262
- test_files:
296
+ test_files:
263
297
  - spec/coverage_helper.rb
264
298
  - spec/devdnsd/application_spec.rb
265
299
  - spec/devdnsd/configuration_spec.rb