Class: Cezanne::LocalFiles
- Inherits:
-
Object
- Object
- Cezanne::LocalFiles
- Defined in:
- lib/cezanne/local_files.rb
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(uid, base_path) ⇒ LocalFiles
constructor
A new instance of LocalFiles.
- #path_for(key) ⇒ Object
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
#clean ⇒ Object
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 |