Class: Pansophy::Synchronizer

Inherits:
Object
  • Object
show all
Defined in:
lib/pansophy/synchronizer.rb

Instance Method Summary collapse

Constructor Details

#initialize(bucket_name, remote_directory, local_directory) ⇒ Synchronizer

Returns a new instance of Synchronizer.



3
4
5
6
# File 'lib/pansophy/synchronizer.rb', line 3

def initialize(bucket_name, remote_directory, local_directory)
  @remote_dir = Remote::Directory.new(bucket_name, remote_directory)
  @local_dir  = Local::Directory.new(local_directory)
end

Instance Method Details

#merge(options = {}) ⇒ Object



16
17
18
# File 'lib/pansophy/synchronizer.rb', line 16

def merge(options = {})
  synchronize(@remote_dir, @local_dir, options.merge(merge: true))
end

#pull(options = {}) ⇒ Object



8
9
10
# File 'lib/pansophy/synchronizer.rb', line 8

def pull(options = {})
  synchronize(@remote_dir, @local_dir, options)
end

#push(options = {}) ⇒ Object



12
13
14
# File 'lib/pansophy/synchronizer.rb', line 12

def push(options = {})
  synchronize(@local_dir, @remote_dir, options)
end