Class: VagrantShellCommander::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-shell-commander/action.rb

Overview

Action for shell command hooking

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Object

Constructor

Parameters:

  • app (Action)

    Next middleware to call

  • env (Hash)

    Action environment



10
11
12
13
# File 'lib/vagrant-shell-commander/action.rb', line 10

def initialize(app, env)
  @app = app
  @machine = env[:machine]
end

Instance Method Details

#call(env) ⇒ Object

Call method of this middleware

Parameters:

  • env (Hash)

    Action environment

Returns:

  • nil



20
21
22
23
24
# File 'lib/vagrant-shell-commander/action.rb', line 20

def call(env)
  @app.call(env)
  @machine.action(:ssh_run, 
                  ssh_run_command: env[:global_config].sh.after_share_folders)
end