vagrant-serial 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vagrant-serial.rb +7 -4
- data/lib/vagrant-serial/middleware/clear_forwarded_ports +17 -0
- data/lib/vagrant-serial/middleware/{configure.rb → configure_ports.rb} +1 -1
- data/lib/vagrant-serial/middleware/{forward.rb → forward_ports.rb} +1 -1
- data/lib/vagrant-serial/version.rb +1 -1
- metadata +4 -3
data/lib/vagrant-serial.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
|
2
2
|
require "vagrant"
|
3
3
|
require "vagrant-serial/version"
|
4
|
-
require "vagrant-serial/middleware/
|
5
|
-
require "vagrant-serial/middleware/
|
4
|
+
require "vagrant-serial/middleware/configure_ports"
|
5
|
+
require "vagrant-serial/middleware/forward_ports"
|
6
|
+
require "vagrant-serial/middleware/clear_forwarded_ports"
|
6
7
|
|
7
|
-
Vagrant.actions[:start].insert_after Vagrant::Action::VM::Customize, Vagrant::Serial::Middleware::
|
8
|
-
Vagrant.actions[:start].insert_after Vagrant::Action::VM::Boot, Vagrant::Serial::Middleware::
|
8
|
+
Vagrant.actions[:start].insert_after Vagrant::Action::VM::Customize, Vagrant::Serial::Middleware::ConfigurePorts
|
9
|
+
Vagrant.actions[:start].insert_after Vagrant::Action::VM::Boot, Vagrant::Serial::Middleware::ForwardPorts
|
10
|
+
Vagrant.actions[:halt].insert_after Vagrant::Action::VM::CheckAccessible, Vagrant::Serial::Middleware::ClearForwardedPorts
|
11
|
+
Vagrant.actions[:suspend].insert_after Vagrant::Action::VM::CheckAccessible, Vagrant::Serial::Middleware::ClearForwardedPorts
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Vagrant
|
2
|
+
module Serial
|
3
|
+
module Middleware
|
4
|
+
class ClearForwardedPorts
|
5
|
+
def initialize(app, env)
|
6
|
+
@app = app
|
7
|
+
end
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
`/sbin/start-stop-daemon --stop --quiet --pidfile #{ENV['HOME']}/serial/socat.#{env[:vm].uuid}-com1.pid --exec /usr/bin/socat && rm #{ENV['HOME']}/serial/socat.#{env[:vm].uuid}-com1.pid`
|
11
|
+
`/sbin/start-stop-daemon --stop --quiet --pidfile #{ENV['HOME']}/serial/socat.#{env[:vm].uuid}-com2.pid --exec /usr/bin/socat && rm #{ENV['HOME']}/serial/socat.#{env[:vm].uuid}-com2.pid`
|
12
|
+
@app.call(env)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-serial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -24,8 +24,9 @@ files:
|
|
24
24
|
- README.md
|
25
25
|
- Rakefile
|
26
26
|
- lib/vagrant-serial.rb
|
27
|
-
- lib/vagrant-serial/middleware/
|
28
|
-
- lib/vagrant-serial/middleware/
|
27
|
+
- lib/vagrant-serial/middleware/clear_forwarded_ports
|
28
|
+
- lib/vagrant-serial/middleware/configure_ports.rb
|
29
|
+
- lib/vagrant-serial/middleware/forward_ports.rb
|
29
30
|
- lib/vagrant-serial/version.rb
|
30
31
|
- lib/vagrant_init.rb
|
31
32
|
- vagrant-serial.gemspec
|