Sha256: f502c2f1b5717d41d0fb645e15548a82710730cf3abbaaa4232594a8837e649c

Contents?: true

Size: 454 Bytes

Versions: 66

Compression:

Stored size: 454 Bytes

Contents

module Jets::Cfn::Builders::Util
  class Source
    class << self
      def version
        return '' unless git_installed?
        sha = sh "git rev-parse HEAD 2>/dev/null"
        return '' if sha == ''  # if its not a git repo, it'll be an empty string
        sha[0..7]
      end

    private
      def git_installed?
        system("type git > /dev/null 2>&1")
      end

      def sh(command)
        `#{command}`.strip
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 2 rubygems

Version Path
jets-4.0.12 lib/jets/cfn/builders/util/source.rb
jets-4.0.11 lib/jets/cfn/builders/util/source.rb
jets-4.0.10 lib/jets/cfn/builders/util/source.rb
jets-4.0.9 lib/jets/cfn/builders/util/source.rb
jets-4.0.8 lib/jets/cfn/builders/util/source.rb
jets-4.0.7 lib/jets/cfn/builders/util/source.rb
jets-4.0.6 lib/jets/cfn/builders/util/source.rb
jets-4.0.5 lib/jets/cfn/builders/util/source.rb
jets-4.0.4 lib/jets/cfn/builders/util/source.rb
jets-4.0.3 lib/jets/cfn/builders/util/source.rb
jets-4.0.2 lib/jets/cfn/builders/util/source.rb
jets-4.0.1 lib/jets/cfn/builders/util/source.rb
jets-4.0.0 lib/jets/cfn/builders/util/source.rb
jets-3.2.2 lib/jets/cfn/builders/util/source.rb
jets-3.2.1 lib/jets/cfn/builders/util/source.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/cfn/builders/util/source.rb
jets-3.2.0 lib/jets/cfn/builders/util/source.rb
jets-3.1.5 lib/jets/cfn/builders/util/source.rb
jets-3.1.4 lib/jets/cfn/builders/util/source.rb
jets-3.1.3 lib/jets/cfn/builders/util/source.rb