devdnsd 1.1.9 → 1.1.10
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.
- data/Gemfile.lock +2 -2
- data/lib/devdnsd/configuration.rb +13 -20
- data/lib/devdnsd/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devdnsd (1.1.
|
4
|
+
devdnsd (1.1.10)
|
5
5
|
bovem (>= 0.5.0)
|
6
6
|
gli (~> 1.6.0)
|
7
7
|
rexec (~> 1.4.1)
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
activesupport (3.2.7)
|
27
27
|
i18n (~> 0.6)
|
28
28
|
multi_json (~> 1.0)
|
29
|
-
bovem (0.
|
29
|
+
bovem (0.6.0)
|
30
30
|
lazier (~> 1.0)
|
31
31
|
rainbow (~> 1.1.0)
|
32
32
|
builder (3.0.0)
|
@@ -8,25 +8,25 @@ module DevDNSd
|
|
8
8
|
# This class holds the configuration of the applicaton.
|
9
9
|
class Configuration < Bovem::Configuration
|
10
10
|
# If to run the server in foreground. Default: `false`.
|
11
|
-
|
11
|
+
property :foreground, :default => false
|
12
12
|
|
13
13
|
# The address to listen to. Default: `0.0.0.0`.
|
14
|
-
|
14
|
+
property :address, :default => "0.0.0.0"
|
15
15
|
|
16
16
|
# The port to listen to. Default: `7771`.
|
17
|
-
|
17
|
+
property :port, :default => 7771
|
18
18
|
|
19
19
|
# The TLD to manage. Default: `dev`.
|
20
|
-
|
20
|
+
property :tld, :default => "dev"
|
21
21
|
|
22
22
|
# The file to log to. Default: `/var/log/devdnsd.log`.
|
23
|
-
|
23
|
+
property :log_file, :default => "/var/log/devdnsd.log"
|
24
24
|
|
25
25
|
# The minimum severity to log. Default: `Logger::INFO`.
|
26
|
-
|
26
|
+
property :log_level, :default => Logger::INFO
|
27
27
|
|
28
28
|
# The rules of the server. By default, every hostname is resolved with `127.0.0.1`.
|
29
|
-
|
29
|
+
property :rules, :default => []
|
30
30
|
|
31
31
|
# Creates a new configuration.
|
32
32
|
# A configuration file is a plain Ruby file with a top-level {Configuration config} object.
|
@@ -42,24 +42,16 @@ module DevDNSd
|
|
42
42
|
# @param logger [Logger] The logger to use for notifications.
|
43
43
|
# @see parse
|
44
44
|
def initialize(file = nil, overrides = {}, logger = nil)
|
45
|
-
@address = "0.0.0.0"
|
46
|
-
@port = 7771
|
47
|
-
@tld = "dev"
|
48
|
-
@log_file = "/var/log/devdnsd.log"
|
49
|
-
@log_level = ::Logger::INFO
|
50
|
-
@rules = []
|
51
|
-
@foreground = false
|
52
|
-
|
53
45
|
super(file, overrides, logger)
|
54
46
|
|
55
47
|
# Make sure some arguments are of correct type
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
48
|
+
self.log_file = $stdout if self.log_file == "STDOUT"
|
49
|
+
self.log_file = $stderr if self.log_file == "STDERR"
|
50
|
+
self.port = self.port.to_integer
|
51
|
+
self.log_level = self.log_level.to_integer
|
60
52
|
|
61
53
|
# Add a default rule
|
62
|
-
self.add_rule(/.+/, "127.0.0.1") if
|
54
|
+
self.add_rule(/.+/, "127.0.0.1") if self.rules.blank?
|
63
55
|
end
|
64
56
|
|
65
57
|
# Adds a rule to the configuration.
|
@@ -69,6 +61,7 @@ module DevDNSd
|
|
69
61
|
# @return [Array] The current set of rule.
|
70
62
|
# @see Rule.create
|
71
63
|
def add_rule(*args, &block)
|
64
|
+
@rules ||= []
|
72
65
|
@rules << DevDNSd::Rule.create(*args, &block)
|
73
66
|
end
|
74
67
|
end
|
data/lib/devdnsd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devdnsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -248,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
segments:
|
250
250
|
- 0
|
251
|
-
hash:
|
251
|
+
hash: 1821900105084633995
|
252
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
253
253
|
none: false
|
254
254
|
requirements:
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
version: '0'
|
258
258
|
segments:
|
259
259
|
- 0
|
260
|
-
hash:
|
260
|
+
hash: 1821900105084633995
|
261
261
|
requirements: []
|
262
262
|
rubyforge_project: devdnsd
|
263
263
|
rubygems_version: 1.8.24
|