class Bundler::LazySpecification
def ==(other)
def ==(other) identifier == other.identifier end
def __materialize__
def __materialize__ @specification = source.specs.search(Gem::Dependency.new(name, version)).last end
def full_name
def full_name if platform == Gem::Platform::RUBY || platform.nil? "#{@name}-#{@version}" else "#{@name}-#{@version}-#{platform}" end end
def identifier
def identifier @__identifier ||= [name, version, source, platform, dependencies].hash end
def initialize(name, version, platform, source = nil)
def initialize(name, version, platform, source = nil) @name = name @version = version @dependencies = [] @platform = platform @source = source @specification = nil end
def method_missing(method, *args, &blk)
def method_missing(method, *args, &blk) raise "LazySpecification has not been materialized yet (calling :#{method} #{args.inspect})" unless @specification return super unless respond_to?(method) @specification.send(method, *args, &blk) end
def respond_to?(*args)
def respond_to?(*args) super || @specification.respond_to?(*args) end
def satisfies?(dependency)
def satisfies?(dependency) @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version)) end
def to_ary
def to_ary nil end
def to_lock
def to_lock if platform == Gem::Platform::RUBY || platform.nil? out = " #{name} (#{version})\n" else out = " #{name} (#{version}-#{platform})\n" end dependencies.sort_by(&:to_s).uniq.each do |dep| next if dep.type == :development out << " #{dep.to_lock}\n" end out end
def to_s
def to_s @__to_s ||= "#{name} (#{version})" end