lh-vagrant-dns 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -2
- data/lib/vagrant-dns/action/create_daemons_dir.rb +4 -0
- data/lib/vagrant-dns/action/create_resolvers.rb +4 -0
- data/lib/vagrant-dns/action/register_patterns.rb +4 -0
- data/lib/vagrant-dns/action/setup_env.rb +4 -0
- data/lib/vagrant-dns/action/start_dns_server.rb +4 -0
- data/lib/vagrant-dns/action/stop_dns_server.rb +4 -0
- data/lib/vagrant-dns/config.rb +27 -5
- data/lib/vagrant-dns/plugin.rb +0 -2
- data/lib/vagrant-dns/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -5,12 +5,18 @@ heavily based on https://github.com/BerlinVagrant/vagrant-dns (which doesn't
|
|
5
5
|
seem to support Vagrant 1.1.x currently), so credit goes to the author of that
|
6
6
|
lib.
|
7
7
|
|
8
|
+
Currently, it doesn't support running multiple vagrant machines. All vagrant-dns
|
9
|
+
related files are located in `~/.vagrant.d/tmp/dns`. This may be something
|
10
|
+
that needs to be addressed later on.
|
11
|
+
|
8
12
|
## TODOs
|
9
13
|
|
10
|
-
*
|
14
|
+
* <del>Default this plugin disabled, and enable by `config.dns.enable = true`</del>
|
11
15
|
* Add config validation
|
16
|
+
* Add specs
|
12
17
|
* Add DNS resolver uninstall command
|
13
18
|
* Add Vagrant destroy action hook to clean dns tmp path
|
19
|
+
* Move resolvers create and installation to command
|
14
20
|
|
15
21
|
## Installation
|
16
22
|
|
@@ -37,7 +43,7 @@ It is only used as a plugin for Vagrant, so to install:
|
|
37
43
|
config.vm.network :private_network, ip: "33.33.33.100"
|
38
44
|
end
|
39
45
|
|
40
|
-
After `vagrant up`, install DNS resolver on mac:
|
46
|
+
**After** `vagrant up`, install DNS resolver on mac:
|
41
47
|
|
42
48
|
$ sudo vagrant dns --install
|
43
49
|
|
@@ -7,6 +7,10 @@ module VagrantPlugins
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call(env)
|
10
|
+
unless env[:machine].config.dns.enabled
|
11
|
+
return @app.call(env)
|
12
|
+
end
|
13
|
+
|
10
14
|
env[:dns].tmp_path = File.join(env[:tmp_path], DNS.namespace)
|
11
15
|
env[:dns].daemon_path = File.join(env[:dns].tmp_path, "daemon")
|
12
16
|
env[:dns].config_file = File.join(env[:dns].tmp_path, "config")
|
data/lib/vagrant-dns/config.rb
CHANGED
@@ -1,19 +1,41 @@
|
|
1
1
|
module VagrantPlugins
|
2
2
|
module DNS
|
3
3
|
class Config < ::Vagrant.plugin("2", :config)
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Enable the use of this plugin
|
5
|
+
#
|
6
|
+
# @return [Boolean]
|
7
|
+
attr_accessor :enabled
|
8
|
+
|
9
|
+
# Configures DNS patterns
|
10
|
+
#
|
11
|
+
# Usage example:
|
12
|
+
#
|
13
|
+
# config.dns.patterns = [/^.*promojam.dev$/, /^.*coca-cola.dev$/]
|
14
|
+
#
|
15
|
+
# @return [Array]
|
16
|
+
attr_accessor :patterns
|
17
|
+
|
18
|
+
# Configures tlds, taking an Array or a String as its argument.
|
19
|
+
#
|
20
|
+
# Usage example:
|
21
|
+
#
|
22
|
+
# config.dns.tlds = ["dev", "dom"]
|
23
|
+
# config.dns.tld = "dev"
|
6
24
|
#
|
7
25
|
def tld=(tlds)
|
8
26
|
@tlds = Array(tlds)
|
9
27
|
end
|
10
28
|
alias :tlds= :tld=
|
11
29
|
|
30
|
+
# @return [Array]
|
12
31
|
attr_reader :tlds
|
13
32
|
|
14
|
-
|
15
|
-
|
16
|
-
|
33
|
+
def initialize
|
34
|
+
super
|
35
|
+
|
36
|
+
@enabled = false
|
37
|
+
end
|
38
|
+
|
17
39
|
end
|
18
40
|
end
|
19
41
|
end
|
data/lib/vagrant-dns/plugin.rb
CHANGED
data/lib/vagrant-dns/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lh-vagrant-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubydns
|