Class: Compaa::DifferenceImage
- Inherits:
-
Struct
- Object
- Struct
- Compaa::DifferenceImage
- Defined in:
- lib/compaa/difference_image.rb
Instance Attribute Summary collapse
-
#file_manager ⇒ Object
writeonly
Sets the attribute file_manager.
-
#path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#file_manager=(value) ⇒ Object
Sets the attribute file_manager
5 6 7 |
# File 'lib/compaa/difference_image.rb', line 5 def file_manager=(value) @file_manager = value end |
#path ⇒ Object
Returns the value of attribute path
4 5 6 |
# File 'lib/compaa/difference_image.rb', line 4 def path @path end |
Class Method Details
.all ⇒ Object
7 8 9 10 11 |
# File 'lib/compaa/difference_image.rb', line 7 def self.all Dir.glob(File.join %w[artifacts differences_in_screenshots_this_run ** *.gif]).map { |path| new path } end |
Instance Method Details
#create_reference_image ⇒ Object
13 14 15 16 17 |
# File 'lib/compaa/difference_image.rb', line 13 def create_reference_image file_manager.mkdir_p File.dirname reference_path file_manager.cp generated_path, reference_path file_manager.rm path end |
#generated_path ⇒ Object
25 26 27 28 29 |
# File 'lib/compaa/difference_image.rb', line 25 def generated_path path.gsub( 'differences_in_screenshots_this_run', 'screenshots_generated_this_run' ).gsub('_difference.gif', '') end |
#reference_path ⇒ Object
19 20 21 22 23 |
# File 'lib/compaa/difference_image.rb', line 19 def reference_path path.gsub( 'differences_in_screenshots_this_run', 'reference_screenshots' ).gsub('_difference.gif', '') end |