6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/fuse/document/asset/has_dependents.rb', line 6
def dependents
collection = Fuse::Document::AssetCollection.new
local_root = File.dirname(full_path)
if ( = raw[])
.lines.each do |line|
if (match = REQUIRE_PATTERN.match(line))
case match[1]
when 'require'
[File.join(local_root, match[2])]
when 'require_glob'
Dir[File.join(local_root, match[2])]
else
[]
end.map do |p|
Fuse::Document::Asset.for(p[@root.length..-1], @root)
end.reject do |p|
p.nil?
end.each do |p|
collection << p
end
end
end
end
collection
end
|