no-regrets 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/no_regrets.rb +12 -2
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 070d2a733e89248fc2b435aab56dd82b5c08500bd5841a2d4ca7fe807475dbc2
|
4
|
+
data.tar.gz: 0a8c61ed0375d725af7ed27efbd6a43be07ebd8ac6a94f23f07d561d75d6f517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1036a64f0e01f37064a0c70d53b71cfebaa589153a67a35612388e911ee1090a54e44878fd3f6a46405c1ee34e090e79336518e9b7e4b8d86df4942629affd
|
7
|
+
data.tar.gz: d6cf971d4ac5499d67013fdd9f7803eb6b8261a045b49370aea52bc5a7e9077c0baaf123de51fed0a8519ae3822e3493aa9d3fab1090f5db04156f29ff843e28
|
data/lib/no_regrets.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'fileutils'
|
1
2
|
require 'digest'
|
2
3
|
require 'launchy'
|
3
4
|
require_relative "no_regrets/image_diff"
|
@@ -28,7 +29,8 @@ class NoRegrets
|
|
28
29
|
puts "Saving a new screenshot fingerprint for \"#{screenshot_name}\" in #{fingerprint_file_path}"
|
29
30
|
end
|
30
31
|
fingerprints[screenshot_name] = sha1
|
31
|
-
|
32
|
+
|
33
|
+
write_fingerprints_file(fingerprints)
|
32
34
|
end
|
33
35
|
|
34
36
|
def initialize(screenshot_name)
|
@@ -40,7 +42,7 @@ class NoRegrets
|
|
40
42
|
attr_reader :screenshot_name
|
41
43
|
|
42
44
|
def fingerprints
|
43
|
-
@fingerprints ||= File.exists?(fingerprint_file_path)
|
45
|
+
@fingerprints ||= (File.exists?(fingerprint_file_path) && YAML.load(File.read(fingerprint_file_path))) || {}
|
44
46
|
end
|
45
47
|
|
46
48
|
def raise_error(new_screenshot_path, new_sha1)
|
@@ -73,6 +75,14 @@ class NoRegrets
|
|
73
75
|
fingerprints[screenshot_name]
|
74
76
|
end
|
75
77
|
|
78
|
+
def write_fingerprints_file(fingerprints)
|
79
|
+
dirname = File.dirname(fingerprint_file_path)
|
80
|
+
unless File.directory?(dirname)
|
81
|
+
FileUtils.mkdir_p(dirname)
|
82
|
+
end
|
83
|
+
File.write(fingerprint_file_path, fingerprints.to_yaml)
|
84
|
+
end
|
85
|
+
|
76
86
|
def fingerprint_file_path
|
77
87
|
'spec/support/no_regret_fingerprints.yml'
|
78
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no-regrets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Mours
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -79,10 +79,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.4.5
|
82
|
+
rubygems_version: 3.0.3
|
84
83
|
signing_key:
|
85
84
|
specification_version: 4
|
86
85
|
summary: Visual regression testing for Capybara specs
|
87
86
|
test_files: []
|
88
|
-
has_rdoc:
|