Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #83 from tenderlove/cleanup

Use any? rather than explicit return true / false
  • Loading branch information...
commit 997b3284b60bd9cb3960a4f8db617a7758876fb4 2 parents 7d9376e + 985e207
@evanphx evanphx authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/rubygems/specification.rb
View
12 lib/rubygems/specification.rb
@@ -1272,17 +1272,13 @@ def conflicts
# Return true if this spec can require +file+.
def contains_requirable_file? file
- root = full_gem_path
+ root = full_gem_path
+ suffixes = Gem.suffixes
- require_paths.each do |lib|
+ require_paths.any? do |lib|
base = "#{root}/#{lib}/#{file}"
- Gem.suffixes.each do |suf|
- path = "#{base}#{suf}"
- return true if File.file? path
- end
+ suffixes.any? { |suf| File.file? "#{base}#{suf}" }
end
-
- return false
end
##
Please sign in to comment.
Something went wrong with that request. Please try again.