Class: VagrantPlugins::HostRubyProvisioner::Provisioner

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-host-ruby-provisioner/provisioner.rb

Instance Method Summary collapse

Instance Method Details

#_execute_cleanObject



4
5
6
# File 'lib/vagrant-host-ruby-provisioner/provisioner.rb', line 4

def _execute_clean
  @config.clean.call
end

#_execute_routineObject



8
9
10
# File 'lib/vagrant-host-ruby-provisioner/provisioner.rb', line 8

def _execute_routine
  @config.routine.call
end

#cleanupObject



12
13
14
15
16
17
18
19
20
# File 'lib/vagrant-host-ruby-provisioner/provisioner.rb', line 12

def cleanup
  if @config.cwd
    routine = method :_execute_clean

    Dir.chdir @config.cwd, &(proc { routine.call })
  else
    _execute_clean
  end
end

#provisionObject



22
23
24
25
26
27
28
29
30
# File 'lib/vagrant-host-ruby-provisioner/provisioner.rb', line 22

def provision
  if @config.cwd
    routine = method :_execute_routine

    Dir.chdir @config.cwd, &(proc { routine.call })
  else
    _execute_routine
  end
end