# File lib/bundler/lazy_specification.rb, line 15 def initialize(name, version, platform, source = nil) @name = name @version = version @dependencies = [] @platform = platform @source = source @specification = nil end
# File lib/bundler/lazy_specification.rb, line 32 def ==(other) identifier == other.identifier end
# File lib/bundler/lazy_specification.rb, line 57 def __materialize__ @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name source.gemspec.tap {|s| s.source = source } else source.specs.search(Gem::Dependency.new(name, version)).last end end
# File lib/bundler/lazy_specification.rb, line 24 def full_name if platform == Gem::Platform::RUBY || platform.nil? "#{@name}-#{@version}" else "#{@name}-#{@version}-#{platform}" end end
# File lib/bundler/lazy_specification.rb, line 77 def identifier @__identifier ||= Identifier.new(name, version, source, platform, dependencies) end
# File lib/bundler/lazy_specification.rb, line 65 def respond_to?(*args) super || @specification ? @specification.respond_to?(*args) : nil end
# File lib/bundler/lazy_specification.rb, line 36 def satisfies?(dependency) @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version)) end
# File lib/bundler/lazy_specification.rb, line 40 def to_lock out = String.new 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
# File lib/bundler/lazy_specification.rb, line 69 def to_s @__to_s ||= if platform == Gem::Platform::RUBY || platform.nil? "#{name} (#{version})" else "#{name} (#{version}-#{platform})" end end
# File lib/bundler/lazy_specification.rb, line 87 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
# File lib/bundler/lazy_specification.rb, line 83 def to_ary nil end