Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve performance of find_files_from_load_path #971

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/rubygems.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -439,8 +439,11 @@ def self.find_files(glob, check_load_path=true)
end end


def self.find_files_from_load_path glob # :nodoc: def self.find_files_from_load_path glob # :nodoc:
search = glob + Gem.suffix_pattern
$LOAD_PATH.map { |load_path| $LOAD_PATH.map { |load_path|
Dir["#{File.expand_path glob, load_path}#{Gem.suffix_pattern}"] Dir.chdir(load_path) {
Dir[search].map! { |f| File.join load_path, f }
}
}.flatten.select { |file| File.file? file.untaint } }.flatten.select { |file| File.file? file.untaint }
end end


Expand Down