For the last 4 days I've been hammering on rubygems to remove SourceIndex from 
internal usage. I'm most of the way there now and just pushed up my changes. I 
kinda expect stuff to break on people so I'm pushing early and often. With some 
minor exceptions, GemPathSearcher and SourceIndex are going to remain 
untouched. Their tests will be removed (or ported elsewhere) and their 
implementation will be removed 6ish months down the line.

Current test runs are deprecation free, but some of that is because I've 
wrapped some stuff with Deprecation.skip_during {...}.

Current Todo:

+ Remove extraneous skip_durings.
+ Add doco to the new methods in Dependency and Specification.
+ Port tests from SourceIndex to Dep/Spec.
+ Switch from SourceIndex.gems being the primary source to Specification.all.
+ Disallow regexps in dependency names.
+ Fix up my deprecations so they point to the new stuff when applicable.
+ Polish the turd.

General Change Summary:

Simple things should stay simple. Like:

-    matches = Gem.source_index.find_name(gem.name)
+    matches = Gem::Specification.find_by_name(gem.name)

and:

-    specs = Gem.source_index.search dependency
+    specs = dependency.matching_specs           # hey look! proper 
responsibilities!

but harder things should get a bit harder:

-      specs = Gem.source_index.search dep
+      specs = Gem::Specification.find_all { |s|
+        s.name =~ name and req =~ s.version
+      }

SourceIndex.search is a mess so I'm discontinuing the mess in favor of more 
transparent Enumerable usage.

I'm sure there is more... but I need to study :D

_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to