Class: Vagrant::Notify::Action::ServerIsRunning

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-notify/action/server_is_running.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ServerIsRunning

Returns a new instance of ServerIsRunning.



5
6
7
8
# File 'lib/vagrant-notify/action/server_is_running.rb', line 5

def initialize(app, env)
  @app    = app
  @logger = Log4r::Logger.new("vagrant::notify::action::prepare_data_dir")
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/vagrant-notify/action/server_is_running.rb', line 10

def call(env)
  env[:result] = valid_process?(env[:notify_data][:pid])

  # 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