Class: Vagrant::Notify::Action::SetSharedFolder

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

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ SetSharedFolder

Returns a new instance of SetSharedFolder.



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

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/vagrant-notify/action/set_shared_folder.rb', line 9

def call(env)
  host_dir = Pathname("/tmp/vagrant-notify/#{env[:machine].id}")
  FileUtils.mkdir_p host_dir.to_s unless host_dir.exist?
  env[:machine].config.vm.synced_folder host_dir, "/tmp/vagrant-notify", id: "vagrant-notify"
  @app.call(env)
end