Class: Vagrant::Action::Builtin::SyncedFolderCleanup
- Inherits:
-
Object
- Object
- Vagrant::Action::Builtin::SyncedFolderCleanup
- Includes:
- MixinSyncedFolders
- Defined in:
- lib/vagrant/action/builtin/synced_folder_cleanup.rb
Overview
This middleware will run cleanup tasks for synced folders using the appropriate synced folder plugin.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ SyncedFolderCleanup
constructor
A new instance of SyncedFolderCleanup.
Methods included from MixinSyncedFolders
#default_synced_folder_type, #impl_opts, #plugins, #save_synced_folders, #synced_folders, #synced_folders_diff
Methods included from Util::ScopedHashOverride
Constructor Details
#initialize(app, env) ⇒ SyncedFolderCleanup
Returns a new instance of SyncedFolderCleanup.
16 17 18 19 |
# File 'lib/vagrant/action/builtin/synced_folder_cleanup.rb', line 16 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant::action::builtin::synced_folder_cleanup") end |
Instance Method Details
#call(env) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant/action/builtin/synced_folder_cleanup.rb', line 21 def call(env) folders = synced_folders(env[:machine]) # Go through each folder and do cleanup folders.each_key do |impl_name| @logger.info("Invoking synced folder cleanup for: #{impl_name}") plugins[impl_name.to_sym][0].new.cleanup( env[:machine], impl_opts(impl_name, env)) end @app.call(env) end |