8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/multi_sync/sources/manifest_source.rb', line 8
def files
files = []
manifest_hash = {}
if defined?(::ActionView::Base) && ::ActionView::Base.respond_to?(:assets_manifest)
manifest_hash = ::ActionView::Base.assets_manifest.files
else
manifest_path = locate_manifest(source_dir)
manifest_hash = parse_manifest(manifest_path)
end
manifest_hash.lazily.each { |key, value|
path = source_dir + key
next if !path.fnmatch?(include.to_s) || path.fnmatch?(exclude.to_s || '')
file = path_to_local_resource(path, mtime: value['mtime'], digest: value['digest'], content_length: value['size'])
files << file
}
files
end
|