class Bundler::Checksum::Source

属性

location[R]
type[R]

公共类方法

new(type, location) 点击切换源代码
# File bundler/checksum.rb, line 123
def initialize(type, location)
  @type = type
  @location = location
end

公共实例方法

==(other) 点击切换源代码
# File bundler/checksum.rb, line 132
def ==(other)
  other.is_a?(self.class) && other.type == type && other.location == location
end
removable?() 点击切换源代码
# File bundler/checksum.rb, line 128
def removable?
  type == :lock || type == :gem
end
removal() 点击切换源代码

一个完整的句子描述如何删除校验和

# 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() 点击切换源代码

措辞应使得通常的字符串格式在语法上正确

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