Sha256: 60956c4bf65218ebe00b160f1d22540b9fa569d0482493e70f7f0e214e754762

Contents?: true

Size: 974 Bytes

Versions: 9

Compression:

Stored size: 974 Bytes

Contents

require 'minigit'

module Vendorificator
  module TestSupport
    module MiniGit
      module MiniGitExt
        def refs(kind)
          show_ref(kind => true).lines.
            map { |ln| ln =~ /[0-9a-f]{40} refs\/#{kind}\// and $'.strip }.
            compact
        rescue ::MiniGit::GitError
          []
        end

        def heads
          refs(:heads)
        end

        def tags
          refs(:tags)
        end

        def note_refs
          show_ref.lines.
            map { |ln| ln =~ /[0-9a-f]{40} refs\/notes\// and $'.strip }.
            compact
        end
      end

      def git
        @git ||= ::MiniGit::Capturing.new(current_dir)
      end

      def remote_git
        @remote_git ||= ::MiniGit::Capturing.new(current_dir + '/../remote-repository')
      end
    end
  end
end

class MiniGit
  include Vendorificator::TestSupport::MiniGit::MiniGitExt
end

MiniGit.debug = true if ENV['DEBUG']

World(Vendorificator::TestSupport::MiniGit)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vendorificator-0.6.0 features/support/minigit.rb
vendorificator-0.5.3 features/support/minigit.rb
vendorificator-0.5.2 features/support/minigit.rb
vendorificator-0.5.1 features/support/minigit.rb
vendorificator-0.5.0 features/support/minigit.rb
vendorificator-0.5.git.v0.4.0.63.g8e9d54d features/support/minigit.rb
vendorificator-0.5.git.v0.4.0.60.g9c35209 features/support/minigit.rb
vendorificator-0.5.git.v0.4.0.17.g26d50d8 features/support/minigit.rb
vendorificator-0.4.0 features/support/minigit.rb