Sha256: 3f79e21132bca6c2096e6e45166e338490c0cd3f4845094fb8288c1aedaad7ed

Contents?: true

Size: 463 Bytes

Versions: 2

Compression:

Stored size: 463 Bytes

Contents

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

module MultiSync
  class LocalSource < Source
    def files
      files = []
      included_files = Dir.glob(source_dir + include)
      excluded_files = exclude.nil? ? [] : Dir.glob(source_dir + exclude)
      (included_files - excluded_files).lazily.each { |path|
        next if File.directory?(path)
        files << path_to_local_resource(path)
      }
      files
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
multi_sync-0.0.2 lib/multi_sync/sources/local_source.rb
multi_sync-0.0.1 lib/multi_sync/sources/local_source.rb