Skip to content

Commit

Permalink
Merge pull request #336 from rails/schneems/fix-asset-lookup-perf-3.x
Browse files Browse the repository at this point in the history
Backport #331 - Asset lookup 4x Faster in large directories
  • Loading branch information
schneems committed Jul 1, 2016
2 parents 697269c + f2e3623 commit 8ad2f39
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -8,6 +8,7 @@ rvm:
- 2.0.0
- 2.1
- 2.2
- 2.3.1

matrix:
include:
Expand Down
8 changes: 8 additions & 0 deletions Gemfile
@@ -1,2 +1,10 @@
source "https://rubygems.org"
gemspec

if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.2.2")
gem 'rack', '< 2.0'
end

if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0")
gem 'json', '< 2.0'
end
2 changes: 2 additions & 0 deletions gemfiles/Gemfile-1.9
@@ -1,3 +1,5 @@
source "https://rubygems.org"
gemspec path: '..'
gem 'sass', '< 3.4'
gem 'rack', '< 2.0'
gem 'json', '< 2.0'
1 change: 1 addition & 0 deletions lib/sprockets/resolve.rb
Expand Up @@ -178,6 +178,7 @@ def dirname_matches(dirname, basename)
candidates = []
entries = self.entries(dirname)
entries.each do |entry|
next unless File.basename(entry).start_with?(basename)
name, type, _, _ = parse_path_extnames(entry)
if basename == name
candidates << [File.join(dirname, entry), type]
Expand Down

0 comments on commit 8ad2f39

Please sign in to comment.