Sha256: 517f3d883872a70d45839f56081921889ef9f40b7400aaf9d7aa6211f16b0390

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

require 'multi_sync/source'
require 'multi_sync/resources/local_resource'

module MultiSync
  class LocalSource < Source
    def files
      files = []
      # create a local_resource from each file
      # making sure to skip any that do not match the include/exclude patterns
      included_files = Dir.glob(source_dir + include)
      excluded_files = exclude.nil? ? [] : Dir.glob(source_dir + exclude)
      (included_files - excluded_files).each { |path|
        next if File.directory?(path)
        files << path_to_local_resource(path)
      }
      files.sort
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_sync-0.0.4 lib/multi_sync/sources/local_source.rb