Class: Vagrant::Notify::Action::ServerIsRunning
- Inherits:
-
Object
- Object
- Vagrant::Notify::Action::ServerIsRunning
- Defined in:
- lib/vagrant-notify/action/server_is_running.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ ServerIsRunning
constructor
A new instance of ServerIsRunning.
Constructor Details
#initialize(app, env) ⇒ ServerIsRunning
Returns a new instance of ServerIsRunning.
7 8 9 10 |
# File 'lib/vagrant-notify/action/server_is_running.rb', line 7 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant::notify::action::prepare_data_dir") end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-notify/action/server_is_running.rb', line 12 def call(env) env[:result] = valid_process?(env[:notify_data][:pid]) unless env[:notify_data][:bind_ip] env[:notify_data][:bind_ip] = env[:machine].config.notify.bind_ip if env[:machine].config.notify.bind_ip.is_a?(String) end # Call the next if we have one (but we shouldn't, since this # middleware is built to run with the Call-type middlewares) @app.call env end |