Sha256: 1e711bdeaaab6654386ec9e8ecb20355f7b7ec71525f90b162e986f208e9870e

Contents?: true

Size: 762 Bytes

Versions: 6

Compression:

Stored size: 762 Bytes

Contents

require 'json'
require_relative '../util'

module Builderator
  module Util
    ##
    # Helpers for packer
    ##
    module Packer
      class << self
        def version(arg = nil)
          return @version = arg unless arg.nil?
          @version || '0.8.6'
        end
        alias_method :use, :version

        def installed?
          File.exist?(path)
        end

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

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
builderator-0.3.15 lib/builderator/util/packer.rb
builderator-0.3.14 lib/builderator/util/packer.rb
builderator-0.3.13 lib/builderator/util/packer.rb
builderator-0.3.12 lib/builderator/util/packer.rb
builderator-0.3.11 lib/builderator/util/packer.rb
builderator-0.3.10 lib/builderator/util/packer.rb