Class: VagrantPlugins::AVF::HelperInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_provider_avf/helper_installer.rb

Instance Method Summary collapse

Constructor Details

#initialize(paths:, command_runner: ->(*command) { Open3.capture3(*command) }) ⇒ HelperInstaller

Returns a new instance of HelperInstaller.



6
7
8
9
# File 'lib/vagrant_provider_avf/helper_installer.rb', line 6

def initialize(paths:, command_runner: ->(*command) { Open3.capture3(*command) })
  @paths = paths
  @command_runner = command_runner
end

Instance Method Details

#installObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/vagrant_provider_avf/helper_installer.rb', line 11

def install
  @paths.helper_binary_path.dirname.mkpath
  return @paths.helper_binary_path if up_to_date?

  build
  sign
  @paths.helper_binary_path
rescue StandardError => error
  raise Errors::AvfHelperBuildFailed, error.message
end