Module: Builderator::Util::Packer

Defined in:
lib/builderator/util/packer.rb

Overview

Helpers for packer

Class Method Summary collapse

Class Method Details

.binObject



29
30
31
# File 'lib/builderator/util/packer.rb', line 29

def bin
  File.join(ENV['HOME'], "packer/packer")
end

.installed?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/builderator/util/packer.rb', line 17

def installed?
  File.exist?(path)
end

.pathObject



25
26
27
# File 'lib/builderator/util/packer.rb', line 25

def path
  File.join(ENV['HOME'], "packer_#{ version }")
end

.platformObject



21
22
23
# File 'lib/builderator/util/packer.rb', line 21

def platform
  `uname -s`.chomp.downcase
end

.urlObject



33
34
35
# File 'lib/builderator/util/packer.rb', line 33

def url
  "https://dl.bintray.com/mitchellh/packer/packer_#{ version }_#{ platform }_amd64.zip"
end

.version(arg = nil) ⇒ Object Also known as: use



11
12
13
14
# File 'lib/builderator/util/packer.rb', line 11

def version(arg = nil)
  return @version = arg unless arg.nil?
  @version || '0.8.6'
end