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-3.1.2 lib/jets/cfn/builders/util/source.rb
jets-3.1.1 lib/jets/cfn/builders/util/source.rb
jets-3.1.0 lib/jets/cfn/builders/util/source.rb
jets-3.0.23 lib/jets/cfn/builders/util/source.rb
jets-3.0.22 lib/jets/cfn/builders/util/source.rb
jets-3.0.21 lib/jets/cfn/builders/util/source.rb
jets-3.0.20 lib/jets/cfn/builders/util/source.rb
jets-3.0.19 lib/jets/cfn/builders/util/source.rb
jets-3.0.18 lib/jets/cfn/builders/util/source.rb
jets-3.0.17 lib/jets/cfn/builders/util/source.rb
jets-3.0.16 lib/jets/cfn/builders/util/source.rb
jets-3.0.15 lib/jets/cfn/builders/util/source.rb
jets-3.0.14 lib/jets/cfn/builders/util/source.rb
jets-3.0.13 lib/jets/cfn/builders/util/source.rb
jets-3.0.12 lib/jets/cfn/builders/util/source.rb
jets-3.0.11 lib/jets/cfn/builders/util/source.rb
jets-3.0.10 lib/jets/cfn/builders/util/source.rb
jets-3.0.9 lib/jets/cfn/builders/util/source.rb
jets-3.0.8 lib/jets/cfn/builders/util/source.rb
jets-3.0.7 lib/jets/cfn/builders/util/source.rb