Sha256: 09672716866f4ba48937114e93eb5ef8865f3769d515387a8a2205eff22ebd57

Contents?: true

Size: 466 Bytes

Versions: 2

Compression:

Stored size: 466 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

2 entries across 2 versions & 1 rubygems

Version Path
concourse-github-status-0.3.0 lib/github-status/support/git.rb
concourse-github-status-0.2.4 lib/github-status/support/git.rb