Class: Photocopier::Adapter
- Inherits:
-
Object
- Object
- Photocopier::Adapter
- Defined in:
- lib/photocopier/adapter.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #delete(remote_path) ⇒ Object
- #get(remote_path, file_path = nil) ⇒ Object
- #get_directory(remote_path, local_path, exclude = []) ⇒ Object
- #put(file_path_or_string, remote_path) ⇒ Object
- #put_directory(local_path, remote_path, exclude = []) ⇒ Object
- #put_file(file_path, remote_path) ⇒ Object
Instance Attribute Details
#logger ⇒ Object
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 |