Class: Cezanne::RemoteFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/cezanne/remote_files.rb

Instance Method Summary collapse

Constructor Details

#initialize(uid, base_path) ⇒ RemoteFiles

Returns a new instance of RemoteFiles.



7
8
9
10
11
12
13
14
15
# File 'lib/cezanne/remote_files.rb', line 7

def initialize uid, base_path
  @remote_folders = {
    ref: File.join('reference_screenshots'),
    diff: File.join(uid, 'different_screenshots'),
    new: File.join(uid, 'new_screenshots')
  }

  @adapter = Dropscreen::Client.new( remote_base_dir: base_path, local_base_dir: './' )
end

Instance Method Details

#exists?(key) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/cezanne/remote_files.rb', line 25

def exists? key
  @adapter.exists? @remote_folders[key]
end

#pull(key, path) ⇒ Object



17
18
19
# File 'lib/cezanne/remote_files.rb', line 17

def pull key, path
  @adapter.pull @remote_folders[key], path
end

#push(path, key) ⇒ Object



21
22
23
# File 'lib/cezanne/remote_files.rb', line 21

def push path, key
  @adapter.push path, @remote_folders[key]
end