class Bundler::Checksum::Source

Attributes

location[R]
type[R]

Public Class Methods

new(type, location) click to toggle source
# File bundler/checksum.rb, line 123
def initialize(type, location)
  @type = type
  @location = location
end

Public Instance Methods

==(other) click to toggle source
# File bundler/checksum.rb, line 132
def ==(other)
  other.is_a?(self.class) && other.type == type && other.location == location
end
removable?() click to toggle source
# File bundler/checksum.rb, line 128
def removable?
  type == :lock || type == :gem
end
removal() click to toggle source

A full sentence describing how to remove the checksum

# File bundler/checksum.rb, line 152
def removal
  case type
  when :lock
    "remove the matching checksum in #{location}"
  when :gem
    "remove the gem at #{location}"
  when :api
    "checksums from #{location} cannot be locally modified, you may need to update your sources"
  else
    "remove #{location} (#{type})"
  end
end
to_s() click to toggle source

phrased so that the usual string format is grammatically correct

rake (10.3.2) sha256=abc123 from #{to_s}
# File bundler/checksum.rb, line 138
def to_s
  case type
  when :lock
    "the lockfile CHECKSUMS at #{location}"
  when :gem
    "the gem at #{location}"
  when :api
    "the API at #{location}"
  else
    "#{location} (#{type})"
  end
end