Class: Gitlab::QA::Report::UpdateScreenshotPath
- Inherits:
-
Object
- Object
- Gitlab::QA::Report::UpdateScreenshotPath
- Defined in:
- lib/gitlab/qa/report/update_screenshot_path.rb
Constant Summary collapse
- REGEX =
%r{(?<gitlab_qa_run>gitlab-qa-run-.*?(?=\/))\/(?<gitlab_ce_ee_qa>gitlab-(ee|ce)-qa-.*?(?=\/))}
Instance Method Summary collapse
-
#initialize(files:) ⇒ UpdateScreenshotPath
constructor
A new instance of UpdateScreenshotPath.
- #invoke! ⇒ Object
Constructor Details
#initialize(files:) ⇒ UpdateScreenshotPath
Returns a new instance of UpdateScreenshotPath.
7 8 9 |
# File 'lib/gitlab/qa/report/update_screenshot_path.rb', line 7 def initialize(files:) @files = files end |
Instance Method Details
#invoke! ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/gitlab/qa/report/update_screenshot_path.rb', line 13 def invoke! Dir.glob(@files).each do |rspec_report_file| report = rewrite_each_screenshot_path(rspec_report_file) File.write(rspec_report_file, report) puts "Saved #{rspec_report_file}" end end |