Class: VagrantPlugins::ProviderVeertu::Action::Package

Inherits:
Vagrant::Action::General::Package
  • Object
show all
Defined in:
lib/vagrant-veertu/action/package.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/vagrant-veertu/action/package.rb', line 12

def call(env)
  # Setup the temporary directory
  @temp_dir = env[:tmp_path].join(Time.now.to_i.to_s)
  env["export.temp_dir"] = @temp_dir
  FileUtils.mkpath(env["export.temp_dir"])

  # Just match up a couple environmental variables so that
  # the superclass will do the right thing. Then, call the
  # superclass
  env["package.directory"] = env["export.temp_dir"]

  general_call(env)

  # Always call recover to clean up the temp dir
  clean_temp_dir
end

#general_callObject

Doing this so that we can test that the parent is properly called in the unit tests.



11
# File 'lib/vagrant-veertu/action/package.rb', line 11

alias_method :general_call, :call

#recover(env) ⇒ Object



29
30
31
32
# File 'lib/vagrant-veertu/action/package.rb', line 29

def recover(env)
  clean_temp_dir
  super
end