Skip to content
Browse files

Simplify building the list of all specs

Conflicts:

	lib/rubygems/specification.rb
  • Loading branch information...
1 parent 3b87837 commit 5590e103e107ee50b7b1cac98eb392c946263c61 @evanphx evanphx committed
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/rubygems/specification.rb
View
15 lib/rubygems/specification.rb
@@ -262,11 +262,18 @@ class Gem::Specification
def self._all # :nodoc:
unless defined?(@@all) && @@all then
- @@all = self.dirs.reverse.map { |dir|
- Dir[File.join(dir, "*.gemspec")].map { |path|
- Gem::Specification.load path
+ specs = []
+
+ self.dirs.reverse_each { |dir|
+ Dir[File.join(dir, "*.gemspec")].each { |path|
+ spec = Gem::Specification.load path.untaint
+ # #load returns nil if the spec is bad, so we just ignore
+ # it at this stage
+ specs << spec if spec
}
- }.flatten
+ }
+
+ @@all = specs
_resort!
end
@@all

0 comments on commit 5590e10

Please sign in to comment.
Something went wrong with that request. Please try again.