Sha256: f18f7fbd7d0fb2ce76c54786b2ec9a0098cf67741371fdc3f6d78b033035e51d

Contents?: true

Size: 785 Bytes

Versions: 17

Compression:

Stored size: 785 Bytes

Contents

module Photocopier
  class Adapter
    attr_accessor :logger

    def put(file_path_or_string, remote_path)
      if File.exists? file_path_or_string
        put_file(file_path_or_string, remote_path)
      else
        file = Tempfile.new('put')
        file.write file_path_or_string
        file.close
        put_file(file.path, remote_path)
        file.unlink
      end
    end

    def put_file(file_path, remote_path); end
    def put_directory(local_path, remote_path, exclude = []); end

    def get(remote_path, file_path = nil); end
    def get_directory(remote_path, local_path, exclude = []); end

    def delete(remote_path); end

    protected

    def run(command)
      if logger.present?
        logger.info command
      end
      system command
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
photocopier-1.3.3.pre3 lib/photocopier/adapter.rb
photocopier-1.3.3.pre2 lib/photocopier/adapter.rb
photocopier-1.3.3.pre1 lib/photocopier/adapter.rb
photocopier-1.3.2 lib/photocopier/adapter.rb
photocopier-1.3.1 lib/photocopier/adapter.rb
photocopier-1.3.0 lib/photocopier/adapter.rb
photocopier-1.3.0.pre3 lib/photocopier/adapter.rb
photocopier-1.3.0.pre2 lib/photocopier/adapter.rb
photocopier-1.3.0.pre lib/photocopier/adapter.rb
photocopier-1.2.0 lib/photocopier/adapter.rb
photocopier-1.1.4 lib/photocopier/adapter.rb
photocopier-1.1.3 lib/photocopier/adapter.rb
photocopier-1.1.2 lib/photocopier/adapter.rb
photocopier-1.1.1 lib/photocopier/adapter.rb
photocopier-1.1.0 lib/photocopier/adapter.rb
photocopier-1.0.0 lib/photocopier/adapter.rb
photocopier-1.0.0.pre3 lib/photocopier/adapter.rb