Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use any? on contains_requirable_file? loops rather than explicit retu…

…rn true / return false
  • Loading branch information...
commit 985e20748c76e2d22832662283462aa32b7742e8 1 parent 7d9376e
@tenderlove 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.