Class: Photocopier::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/photocopier/adapter.rb

Direct Known Subclasses

FTP, SSH

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



3
4
5
# File 'lib/photocopier/adapter.rb', line 3

def logger
  @logger
end

Instance Method Details

#delete(remote_path) ⇒ Object



23
# File 'lib/photocopier/adapter.rb', line 23

def delete(remote_path); end

#get(remote_path, file_path = nil) ⇒ Object



20
# File 'lib/photocopier/adapter.rb', line 20

def get(remote_path, file_path = nil); end

#get_directory(remote_path, local_path, exclude = []) ⇒ Object



21
# File 'lib/photocopier/adapter.rb', line 21

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

#put(file_path_or_string, remote_path) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/photocopier/adapter.rb', line 5

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

#put_directory(local_path, remote_path, exclude = []) ⇒ Object



18
# File 'lib/photocopier/adapter.rb', line 18

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

#put_file(file_path, remote_path) ⇒ Object



17
# File 'lib/photocopier/adapter.rb', line 17

def put_file(file_path, remote_path); end