class Dbox::Syncer
Constants
- MIN_BYTES_TO_STREAM_DOWNLOAD
Public Class Methods
api()
click to toggle source
# File lib/dbox/syncer.rb, line 34 def self.api @@_api ||= API.connect end
clone(remote_path, local_path)
click to toggle source
# File lib/dbox/syncer.rb, line 12 def self.clone(remote_path, local_path) api.metadata(remote_path) # ensure remote exists database = Database.create(remote_path, local_path) Pull.new(database, api).execute end
create(remote_path, local_path)
click to toggle source
# File lib/dbox/syncer.rb, line 7 def self.create(remote_path, local_path) api.create_dir(remote_path) clone(remote_path, local_path) end
move(new_remote_path, local_path)
click to toggle source
# File lib/dbox/syncer.rb, line 28 def self.move(new_remote_path, local_path) database = Database.load(local_path) api.move(database.metadata[:remote_path], new_remote_path) database.update_metadata(:remote_path => new_remote_path) end
pull(local_path)
click to toggle source
# File lib/dbox/syncer.rb, line 18 def self.pull(local_path) database = Database.load(local_path) Pull.new(database, api).execute end
push(local_path)
click to toggle source
# File lib/dbox/syncer.rb, line 23 def self.push(local_path) database = Database.load(local_path) Push.new(database, api).execute end