lib/vagrant-notify/action/start_server.rb in vagrant-notify-0.5.0 vs lib/vagrant-notify/action/start_server.rb in vagrant-notify-0.5.1
- old
+ new
@@ -15,10 +15,12 @@
@env = env
port = next_available_port
id = env[:machine].id
dir = File.expand_path('../../', __FILE__)
+
+ return if env[:machine].config.notify.enable == false
if which('ruby')
env[:notify_data][:pid] = Process.spawn("ruby #{dir}/server.rb #{id} #{port}")
env[:notify_data][:port] = port
@@ -27,9 +29,10 @@
else
env[:machine].ui.error("Unable to spawn TCPServer daemon, ruby not found in $PATH")
end
@app.call env
+
end
def next_available_port
# Determine a list of usable ports for us to use
usable_ports = Set.new(@env[:machine].config.vm.usable_port_range)