class Bundler::LazySpecification
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 or platform.nil? then "#{@name}-#{@version}" else "#{@name}-#{@version}-#{platform}" end 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) if Gem::Specification.new.respond_to?(method) raise "LazySpecification has not been materialized yet (calling :#{method} #{args.inspect})" unless @specification @specification.send(method, *args, &blk) else super end 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_lock
def to_lock if platform == Gem::Platform::RUBY or platform.nil? out = " #{name} (#{version})\n" else out = " #{name} (#{version}-#{platform})\n" end dependencies.sort_by {|d| d.name }.each do |dep| next if dep.type == :development out << " #{dep.to_lock}\n" end out end
def to_s
def to_s "#{name} (#{version})" end