Object
# File lib/bundler/index.rb, line 58 58: def <<(spec) 59: arr = @specs[spec.name] 60: 61: arr.delete_if do |s| 62: s.version == spec.version && s.platform == spec.platform 63: end 64: 65: arr << spec 66: spec 67: end
# File lib/bundler/index.rb, line 84 84: def ==(o) 85: all? do |s| 86: s2 = o[s].first and (s.dependencies & s2.dependencies).empty? 87: end 88: end
# File lib/bundler/index.rb, line 69 69: def each(&blk) 70: @specs.values.each do |specs| 71: specs.each(&blk) 72: end 73: end
# File lib/bundler/index.rb, line 23 23: def empty? 24: each { return false } 25: true 26: end
# File lib/bundler/index.rb, line 16 16: def initialize_copy(o) 17: super 18: @cache = {} 19: @specs = Hash.new { |h,k| h[k] = [] } 20: merge!(o) 21: end
# File lib/bundler/index.rb, line 28 28: def search(query) 29: case query 30: when Gem::Specification, RemoteSpecification, LazySpecification then search_by_spec(query) 31: when String then @specs[query] 32: else search_by_dependency(query) 33: end 34: end
# File lib/bundler/index.rb, line 36 36: def search_for_all_platforms(dependency, base = []) 37: specs = @specs[dependency.name] + base 38: 39: wants_prerelease = dependency.requirement.prerelease? 40: only_prerelease = specs.all? {|spec| spec.version.prerelease? } 41: found = specs.select { |spec| dependency =~ spec } 42: 43: unless wants_prerelease || only_prerelease 44: found.reject! { |spec| spec.version.prerelease? } 45: end 46: 47: found.sort_by {|s| [s.version, s.platform.to_s == 'ruby' ? "\00"" : s.platform.to_s] } 48: end
# File lib/bundler/index.rb, line 98 98: def search_by_dependency(dependency) 99: @cache[dependency.hash] ||= begin 100: specs = @specs[dependency.name] 101: 102: wants_prerelease = dependency.requirement.prerelease? 103: only_prerelease = specs.all? {|spec| spec.version.prerelease? } 104: found = specs.select { |spec| dependency =~ spec && Gem::Platform.match(spec.platform) } 105: 106: unless wants_prerelease || only_prerelease 107: found.reject! { |spec| spec.version.prerelease? } 108: end 109: 110: found.sort_by {|s| [s.version, s.platform.to_s == 'ruby' ? "\00"" : s.platform.to_s] } 111: end 112: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.