Class: Vagrant::Notify::Action::SetSharedFolder
- Inherits:
-
Object
- Object
- Vagrant::Notify::Action::SetSharedFolder
- Defined in:
- lib/vagrant-notify/action/set_shared_folder.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ SetSharedFolder
constructor
A new instance of SetSharedFolder.
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 |