Sha256: 5ac3d48156eaee30702644b17a779695a0b6bfd31e52cd50a59816ab338db46c

Contents?: true

Size: 722 Bytes

Versions: 14

Compression:

Stored size: 722 Bytes

Contents

require 'r10k/errors'

module R10K
  module Git

    class GitError < R10KError
    end

    class UnresolvableRefError < GitError

      attr_reader :ref
      attr_reader :git_dir

      def initialize(*args)
        super

        @hash    = @options[:ref]
        @git_dir = @options[:git_dir]
      end

      HASHLIKE = %r[[A-Fa-f0-9]]

      # Print a friendly error message if an object hash is given as the message
      def message
        if @mesg
          msg = @mesg
        else
          msg = "Could not locate hash"

          if @hash
            msg << " '#{@hash}'"
          end
        end

        if @git_dir
          msg << " at #{@git_dir}"
        end

        msg
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
r10k-1.3.5 lib/r10k/git/errors.rb
r10k-1.3.4 lib/r10k/git/errors.rb
r10k-1.2.4 lib/r10k/git/errors.rb
r10k-1.3.3 lib/r10k/git/errors.rb
r10k-1.3.2 lib/r10k/git/errors.rb
r10k-1.2.3 lib/r10k/git/errors.rb
r10k-1.3.1 lib/r10k/git/errors.rb
r10k-1.2.2 lib/r10k/git/errors.rb
r10k-1.3.0 lib/r10k/git/errors.rb
r10k-1.3.0rc1 lib/r10k/git/errors.rb
r10k-1.2.1 lib/r10k/git/errors.rb
r10k-1.2.0 lib/r10k/git/errors.rb
r10k-1.2.0rc2 lib/r10k/git/errors.rb
r10k-1.2.0rc1 lib/r10k/git/errors.rb