Sha256: c07cd7456c0a840e753c679b84e56280493e56951a4faeefc7c0089336487f67

Contents?: true

Size: 468 Bytes

Versions: 11

Compression:

Stored size: 468 Bytes

Contents

require 'contracts'
require 'git'

module GitHubStatus
  module Support
    module Git
      include ::Contracts::Core
      include ::Contracts::Builtin

      Contract None => ::Git::Base
      def git
        @git ||= ::Git.open "#{workdir}/#{path}"
      rescue ArgumentError
        STDERR.puts "#{path} is not a git repository"
        abort
      end

      Contract None => String
      def sha
        @sha ||= git.revparse 'HEAD'
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
concourse-github-status-0.5.11 lib/github-status/support/git.rb
concourse-github-status-0.5.10 lib/github-status/support/git.rb
concourse-github-status-0.5.9 lib/github-status/support/git.rb
concourse-github-status-0.5.8 lib/github-status/support/git.rb
concourse-github-status-0.5.7 lib/github-status/support/git.rb
concourse-github-status-0.5.0 lib/github-status/support/git.rb
concourse-github-status-0.4.3 lib/github-status/support/git.rb
concourse-github-status-0.4.2 lib/github-status/support/git.rb
concourse-github-status-0.4.1 lib/github-status/support/git.rb
concourse-github-status-0.4.0 lib/github-status/support/git.rb
concourse-github-status-0.3.1 lib/github-status/support/git.rb