Class: DiffuxCIAction
- Inherits:
-
Object
- Object
- DiffuxCIAction
- Defined in:
- lib/diffux_ci_action.rb
Instance Method Summary collapse
- #approve ⇒ Object
-
#initialize(example_description, viewport_name) ⇒ DiffuxCIAction
constructor
A new instance of DiffuxCIAction.
- #reject ⇒ Object
Constructor Details
#initialize(example_description, viewport_name) ⇒ DiffuxCIAction
5 6 7 8 |
# File 'lib/diffux_ci_action.rb', line 5 def initialize(example_description, ) @example_description = example_description = end |
Instance Method Details
#approve ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/diffux_ci_action.rb', line 10 def approve diff_path = DiffuxCIUtils.path_to( @example_description, , 'diff.png') baseline_path = DiffuxCIUtils.path_to( @example_description, , 'baseline.png') candidate_path = DiffuxCIUtils.path_to( @example_description, , 'candidate.png') FileUtils.rm(diff_path, force: true) FileUtils.mv(candidate_path, baseline_path) if File.exist? candidate_path end |
#reject ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/diffux_ci_action.rb', line 22 def reject diff_path = DiffuxCIUtils.path_to( @example_description, , 'diff.png') candidate_path = DiffuxCIUtils.path_to( @example_description, , 'candidate.png') FileUtils.rm(diff_path, force: true) FileUtils.rm(candidate_path, force: true) end |