Module: Builderator::Util::Packer
- Defined in:
- lib/builderator/util/packer.rb
Overview
Helpers for packer
Class Method Summary collapse
- .bin ⇒ Object
- .installed? ⇒ Boolean
- .path ⇒ Object
- .platform ⇒ Object
- .url ⇒ Object
- .version(arg = nil) ⇒ Object (also: use)
Class Method Details
.bin ⇒ Object
29 30 31 |
# File 'lib/builderator/util/packer.rb', line 29 def bin File.join(ENV['HOME'], "packer/packer") end |
.installed? ⇒ Boolean
17 18 19 |
# File 'lib/builderator/util/packer.rb', line 17 def installed? File.exist?(path) end |
.path ⇒ Object
25 26 27 |
# File 'lib/builderator/util/packer.rb', line 25 def path File.join(ENV['HOME'], "packer_#{ version }") end |
.platform ⇒ Object
21 22 23 |
# File 'lib/builderator/util/packer.rb', line 21 def platform `uname -s`.chomp.downcase end |
.url ⇒ Object
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 |