cyrun 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e62e6731281630f345c8e1cd166158771fee4ecbd076648922da738eac4242a
4
- data.tar.gz: 5dcd1a2da03d3370d916474abc34c25ad978790efa03ab06908528987dea34a5
3
+ metadata.gz: 22f061f7542fcae4b9a2dedd25e8a587609a1b92d3b7ca27e2a52877184908e7
4
+ data.tar.gz: 4121f67c20e6f5ecb7af1963b6968362d5fa1316cb84ecd1d3904dc605711318
5
5
  SHA512:
6
- metadata.gz: 7f12fef457aa139ee04dd87b2bf8de75376e1cbb2e2a3ef5ba166212b45879ea288212c88d586740e32c2b3c81c3cee876ee28ddcf13762dcf6bc7c944aeb9a7
7
- data.tar.gz: b25ad55b81bba08903b632db69b6d8236243e1dfccb2a26571300bde52b6dc989b55093f762d7a036c98b9d9ffac07fb963310650e95b28ef9fb2da524a61648
6
+ metadata.gz: 6ea6474ebbb7bc53454f106c1c129321e6fcce19878c9ed57ed339a51a0275850a796ab8ab5321cacf64f9681842fb4bf7f259ad9b6259abc23065e3cfd42576
7
+ data.tar.gz: d8cdec67384115be7599ae31f52bccb12d9f6803486eba1f7dbd723df274e31f8b5342f7666ce6f662eea60a8d023b4c4f775a4f549ce0ded3194c76b41052f0
data/lib/cyrun/runner.rb CHANGED
@@ -62,15 +62,24 @@ module Cyrun
62
62
 
63
63
  info "Moving #{results.screenshots.size} screenshots to #{directory}"
64
64
  results.screenshots.each do |path|
65
- FileUtils.mv(path, "#{directory}/#{SecureRandom.uuid}-#{File.basename(path)}")
66
- rescue StandardError => e
67
- error "Failed to move screenshot #{path}: #{e.message}"
68
- success = false
65
+ success &&= move_screenshot path, directory
69
66
  end
70
67
 
71
68
  success
72
69
  end
73
70
 
71
+ def move_screenshot(path, directory)
72
+ target_path = "#{directory}/#{SecureRandom.uuid}-#{File.basename(path)}"
73
+ info " -> Moving #{path} to #{target_path}"
74
+ FileUtils.mv(path, target_path)
75
+
76
+ true
77
+ rescue StandardError => e
78
+ error "Failed to move screenshot #{path}: #{e.message}"
79
+
80
+ false
81
+ end
82
+
74
83
  def collect_specs
75
84
  info 'Collecting specs ...'
76
85
  collector.files.each do |filename|
data/lib/cyrun/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cyrun
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/sig/runner.rbs CHANGED
@@ -21,6 +21,9 @@ module Cyrun
21
21
  def collect_specs: (String) -> void
22
22
 
23
23
  def copy_result_files: (Array[SingleSpecExecutionResult], String) -> bool
24
+
25
+ def move_screenshot: (String, String)-> bool
26
+
24
27
  def move_screenshots: (SpecGroupExecutionResult, String) -> bool
25
28
 
26
29
  def handle_single_execution_result: (SingleSpecExecutionResult) -> void
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyrun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Kirmis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize