Sha256: 1261af04847be6fc7b9a60c94dc5c228d0a598d32a9018a9d77f5d3d45759b06

Contents?: true

Size: 473 Bytes

Versions: 21

Compression:

Stored size: 473 Bytes

Contents

module LogCabin
  module Modules
    ##
    # Pull state from a git hash
    module GitHash
      include Prospectus.helpers.find(:chdir)

      def load!
        chdir_helper do
          short_arg = @long ? '' : '--short'
          hash = `git rev-parse #{short_arg} HEAD 2>/dev/null`.chomp
          raise('No hash found') if hash.empty?
          @state.value = hash
        end
      end

      private

      def long
        @long = true
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
prospectus-0.9.0 lib/prospectus/modules/git_hash.rb
prospectus-0.8.1 lib/prospectus/modules/git_hash.rb
prospectus-0.8.0 lib/prospectus/modules/git_hash.rb
prospectus-0.6.0 lib/prospectus/modules/git_hash.rb
prospectus-0.5.8 lib/prospectus/modules/git_hash.rb
prospectus-0.5.7 lib/prospectus/modules/git_hash.rb
prospectus-0.5.6 lib/prospectus/modules/git_hash.rb
prospectus-0.5.5 lib/prospectus/modules/git_hash.rb
prospectus-0.5.4 lib/prospectus/modules/git_hash.rb
prospectus-0.5.2 lib/prospectus/modules/git_hash.rb
prospectus-0.5.1 lib/prospectus/modules/git_hash.rb
prospectus-0.5.0 lib/prospectus/modules/git_hash.rb
prospectus-0.4.0 lib/prospectus/modules/git_hash.rb
prospectus-0.3.0 lib/prospectus/modules/git_hash.rb
prospectus-0.2.2 lib/prospectus/modules/git_hash.rb
prospectus-0.2.1 lib/prospectus/modules/git_hash.rb
prospectus-0.2.0 lib/prospectus/modules/git_hash.rb
prospectus-0.1.1 lib/prospectus/modules/git_hash.rb
prospectus-0.1.0 lib/prospectus/modules/git_hash.rb
prospectus-0.0.15 lib/prospectus/modules/git_hash.rb