14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/sprockets/gem_paths.rb', line 14
def append_gem_paths
try_paths = [
%w{ assets },
%w{ app },
%w{ app assets },
%w{ vendor },
%w{ vendor assets },
%w{ lib },
%w{ lib assets }
].inject([]) do |sum, v|
sum + [
File.join(v, 'javascripts'),
File.join(v, 'stylesheets'),
File.join(v, 'images'),
File.join(v, 'fonts')
]
end
(Sprockets::GemPaths.rubygems_latest_specs.map(&:full_gem_path)).each do |root_path|
try_paths.map {|p| File.join(root_path, p) }.
select {|p| File.directory?(p) }.
each {|path| append_path(path) }
end
end
|