Class: VagrantPlugins::Export::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-export/exporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(env, logger) ⇒ Exporter

Returns a new instance of Exporter.

Parameters:

  • env

    Vagrant::Environment

  • logger

    Log4r::Logger



14
15
16
17
# File 'lib/vagrant-export/exporter.rb', line 14

def initialize env, logger
  @env = env
  @logger = logger
end

Instance Method Details

#handle(vm, fast, bare) ⇒ Object

Parameters:

  • vm

    Vagrant::Machine

  • fast

    Boolean

  • bare

    Boolean



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/vagrant-export/exporter.rb', line 22

def handle(vm, fast, bare)
  @vm = vm
  @did_run = false

  unless fast
    if can_compress
      compress
    else
      @env.uid.error('Cannot compress this type of machine')
      return 1
    end
  end

  return 1 unless export
  return 1 unless files(bare)

  finalize
end