Class: MultiSync::ManifestSource

Inherits:
Source
  • Object
show all
Defined in:
lib/multi_sync/sources/manifest_source.rb

Instance Method Summary collapse

Methods inherited from Source

#initialize

Constructor Details

This class inherits a constructor from MultiSync::Source

Instance Method Details

#filesObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/multi_sync/sources/manifest_source.rb', line 8

def files
  files = []
  # create a local_resource from each file
  # making sure to skip any that do not match the include/exclude patterns
  manifest_hash.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.sort
end