Exception: R10K::Git::UnresolvableRefError

Inherits:
GitError
  • Object
show all
Defined in:
lib/r10k/git/errors.rb

Constant Summary collapse

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

Instance Attribute Summary collapse

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from Error

wrap

Constructor Details

#initialize(*args) ⇒ UnresolvableRefError

Returns a new instance of UnresolvableRefError.



13
14
15
16
17
18
# File 'lib/r10k/git/errors.rb', line 13

def initialize(*args)
  super

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

Instance Attribute Details

#git_dirObject (readonly)

Returns the value of attribute git_dir.



11
12
13
# File 'lib/r10k/git/errors.rb', line 11

def git_dir
  @git_dir
end

#refObject (readonly)

Returns the value of attribute ref.



10
11
12
# File 'lib/r10k/git/errors.rb', line 10

def ref
  @ref
end

Instance Method Details

#messageObject

Print a friendly error message if an object hash is given as the message



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/r10k/git/errors.rb', line 23

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