vagrant-dns 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 55d0e6f7cc3427342989a00be7f483e305bf346e
4
- data.tar.gz: 5736ee829fe8700bb53645e3ad8449d330277029
2
+ SHA256:
3
+ metadata.gz: 79dfdc20901e6817d9acb8d2833a1be00655cd974b2d9d6afbffc5ddea2d3ff2
4
+ data.tar.gz: 6c4fa0e10842aee72a453b368bb535a0d450f64b2c0eb88e1479d1a4d83f2984
5
5
  SHA512:
6
- metadata.gz: 5135212305291f8c7fc655545ff4dcf76a1f8c040c0aab0d70ee5d090fdee6767a0fb5f71a8391448cb72bad890b75d31840aa6483155e15e84e9b0e4c5bb794
7
- data.tar.gz: a961387709f85227bcf2792f75c4913ddb666bd1620a6fbeb869ad467ed9edb5c520835ce48e7d01a71cc49c3ba39ac9e58aba77bb23a75417b7a5e1de22d4cb
6
+ metadata.gz: 7b55bfad4178e4dfb15fff551de3fde4ab324520ce4d4e1e2cab3acc13b67b3e9d194be2af2e0281922b9f03061540472decda0f5ca94173f1600add4fbdd9ae
7
+ data.tar.gz: 0cbd95cb993d9cc857838629ad7eaeb6c5708c53b337b246c685468783a3e0864bc7f1ff6e9b8afe675add2b173ef09e4e9def27d038915e503be59440d794b4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 2.2.3
2
+
3
+ ### Fixes:
4
+
5
+ * Workaround for a Vargant-on-Ventura issue, crashing the DNS process. [GH-72]
6
+
7
+ ## 2.2.2
8
+
9
+ ### Fixes:
10
+
11
+ * Installation issue due to updated sub-dependency. [GH-69]
12
+
1
13
  ## 2.2.1
2
14
 
3
15
  ### Fixes:
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
- ruby(ENV['TEST_RUBY_VERSION'] || '~> 2.4.4')
2
+ ruby(ENV['TEST_RUBY_VERSION'] || '~> 2.7.3')
3
3
 
4
- ENV['TEST_VAGRANT_VERSION'] ||= 'v2.1.4'
4
+ ENV['TEST_VAGRANT_VERSION'] ||= 'v2.3.4'
5
5
 
6
6
  # Using the :plugins group causes Vagrant to automagially load auto_network
7
7
  # during acceptance tests.
@@ -23,6 +23,6 @@ group :test do
23
23
  gem 'rake'
24
24
  end
25
25
 
26
- if File.exists? "#{__FILE__}.local"
26
+ if File.exist? "#{__FILE__}.local"
27
27
  eval(File.read("#{__FILE__}.local"), binding)
28
28
  end
@@ -120,11 +120,9 @@ module VagrantDNS
120
120
  end
121
121
 
122
122
  def resolver_file(port)
123
- contents = <<-FILE
124
- # this file is generated by vagrant-dns
125
- nameserver 127.0.0.1
126
- port #{port}
127
- FILE
123
+ "# this file is generated by vagrant-dns\n" \
124
+ "nameserver 127.0.0.1\n" \
125
+ "port #{port}\n"
128
126
  end
129
127
 
130
128
  def resolver_folder
@@ -9,49 +9,58 @@ module VagrantDNS
9
9
  end
10
10
 
11
11
  def start!(opts = {})
12
- run_options = {
13
- :ARGV => ["start"],
14
- :ontop => opts[:ontop]
15
- }.merge!(runopts)
16
- run!(run_options)
12
+ run!("start", { ontop: opts[:ontop] })
17
13
  end
18
14
 
19
15
  def stop!
20
- run_options = {:ARGV => ["stop"]}.merge(runopts)
21
- run!(run_options)
16
+ run!("stop")
22
17
  end
23
18
 
24
19
  def status!
25
- run_options = {:ARGV => ["status"]}.merge(runopts)
26
- run!(run_options)
20
+ run!("status")
27
21
  end
28
22
 
29
- def run!(run_options)
30
- Daemons.run_proc("vagrant-dns", run_options) do
23
+ SERVER = Proc.new do |tmp_path, skip_require_dependencies|
24
+ unless skip_require_dependencies
31
25
  require 'rubydns'
32
26
  require 'async/dns/system'
27
+ end
33
28
 
34
- registry = Registry.new(tmp_path).to_hash
35
- std_resolver = RubyDNS::Resolver.new(Async::DNS::System.nameservers)
36
- ttl = VagrantDNS::Config.ttl
29
+ registry = Registry.new(tmp_path).to_hash
30
+ std_resolver = RubyDNS::Resolver.new(Async::DNS::System.nameservers)
31
+ ttl = VagrantDNS::Config.ttl
37
32
 
38
- RubyDNS::run_server(VagrantDNS::Config.listen) do
39
- registry.each do |pattern, ip|
40
- match(pattern, Resolv::DNS::Resource::IN::A) do |transaction, match_data|
41
- transaction.respond!(ip, ttl: ttl)
42
- end
33
+ RubyDNS::run_server(VagrantDNS::Config.listen) do
34
+ registry.each do |pattern, ip|
35
+ match(pattern, Resolv::DNS::Resource::IN::A) do |transaction, match_data|
36
+ transaction.respond!(ip, ttl: ttl)
43
37
  end
38
+ end
44
39
 
45
- otherwise do |transaction|
46
- transaction.passthrough!(std_resolver) do |reply, reply_name|
47
- puts reply
48
- puts reply_name
49
- end
40
+ otherwise do |transaction|
41
+ transaction.passthrough!(std_resolver) do |reply, reply_name|
42
+ puts reply
43
+ puts reply_name
50
44
  end
51
45
  end
52
46
  end
53
47
  end
54
48
 
49
+ def run!(cmd, opts = {})
50
+ # On darwin, when the running Ruby is not compiled for the running OS
51
+ # @see: https://github.com/BerlinVagrant/vagrant-dns/issues/72
52
+ use_issue_72_workround = RUBY_PLATFORM.match?(/darwin/) && !RUBY_PLATFORM.end_with?(`uname -r`[0, 2])
53
+
54
+ if cmd == "start" && use_issue_72_workround
55
+ require 'rubydns'
56
+ require 'async/dns/system'
57
+ end
58
+
59
+ Daemons.run_proc("vagrant-dns", run_options(cmd, opts)) do
60
+ SERVER.call(tmp_path, use_issue_72_workround)
61
+ end
62
+ end
63
+
55
64
  def restart!(start_opts = {})
56
65
  stop!
57
66
  start!(start_opts)
@@ -69,13 +78,17 @@ module VagrantDNS
69
78
  end
70
79
  end
71
80
 
72
- def runopts
81
+ private
82
+
83
+ def run_options(cmd, extra = {})
73
84
  daemon_dir = File.join(tmp_path, "daemon")
74
85
  {
75
- :dir_mode => :normal,
76
- :dir => daemon_dir,
77
- :log_output => true,
78
- :log_dir => daemon_dir
86
+ ARGV: [cmd],
87
+ dir_mode: :normal,
88
+ dir: daemon_dir,
89
+ log_output: true,
90
+ log_dir: daemon_dir,
91
+ **extra
79
92
  }
80
93
  end
81
94
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantDNS
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.3"
3
3
  end
data/vagrant-dns.gemspec CHANGED
@@ -22,5 +22,10 @@ Gem::Specification.new do |gem|
22
22
  gem.add_dependency "rubydns", '~> 2.0.0'
23
23
  gem.add_dependency "public_suffix"
24
24
 
25
+ # Pinning async gem to work around an issue in vagrant, where it does not
26
+ # honor "required_ruby_version" while resolving sub-dependencies.
27
+ # see: https://github.com/hashicorp/vagrant/issues/12640
28
+ gem.add_dependency 'async', '< 2'
29
+
25
30
  gem.add_development_dependency 'rspec'
26
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dns
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Gilcher
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-22 00:00:00.000000000 Z
12
+ date: 2023-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: async
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '2'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "<"
68
+ - !ruby/object:Gem::Version
69
+ version: '2'
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: rspec
58
72
  requirement: !ruby/object:Gem::Requirement
@@ -117,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
131
  - !ruby/object:Gem::Version
118
132
  version: '0'
119
133
  requirements: []
120
- rubyforge_project:
121
- rubygems_version: 2.6.14.4
134
+ rubygems_version: 3.3.26
122
135
  signing_key:
123
136
  specification_version: 4
124
137
  summary: vagrant-dns manages DNS records of vagrant machines