method
load_specs
v2_2_9 -
Show latest stable
-
0 notes -
Class: Local
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
load_specs(type)
public
Hide source
# File lib/rubygems/source/local.rb, line 35 def load_specs type # :nodoc: names = [] @specs = {} Dir["*.gem"].each do |file| begin pkg = Gem::Package.new(file) rescue SystemCallError, Gem::Package::FormatError # ignore else tup = pkg.spec.name_tuple @specs[tup] = [File.expand_path(file), pkg] case type when :released unless pkg.spec.version.prerelease? names << pkg.spec.name_tuple end when :prerelease if pkg.spec.version.prerelease? names << pkg.spec.name_tuple end when :latest tup = pkg.spec.name_tuple cur = names.find { |x| x.name == tup.name } if !cur names << tup elsif cur.version < tup.version names.delete cur names << tup end else names << pkg.spec.name_tuple end end end names end