Class: Cezanne::LocalFiles

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

Instance Method Summary collapse

Constructor Details

#initialize(uid, base_path) ⇒ LocalFiles

Returns a new instance of LocalFiles.



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

def initialize uid, base_path

  @folders = {
    ref: File.join(base_path, 'reference_screenshots'),
    diff: File.join(base_path, uid, 'different_screenshots'),
    new: File.join(base_path, uid, 'new_screenshots'),
    tmp: File.join(base_path, uid, 'tmp_screenshots')
  }

  @folders.each { |key, path| setup_directory_for key }

end

Instance Method Details

#cleanObject



22
23
24
25
# File 'lib/cezanne/local_files.rb', line 22

def clean
  path = File.dirname( path_for(:ref) )
  FileUtils.rm_rf path
end

#path_for(key) ⇒ Object



18
19
20
# File 'lib/cezanne/local_files.rb', line 18

def path_for key
  @folders[key]
end