diffux-core 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/diffux-compare +1 -1
- data/lib/diffux_core/snapshot_comparer.rb +18 -2
- data/lib/diffux_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f87e09961b1bd5d9f36a2786b657017f74828ba
|
4
|
+
data.tar.gz: bf099cf00f3310ca0589921fb050df0b3abc58d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02117d0af3500c1f63a60f26ebd7df4417e6c6665ab1de0a0f901f26c2819550b21a2ef065c292f62bd1a123605788b17800b78cf4dbf6fa1407879b9bd35084
|
7
|
+
data.tar.gz: b5bde1f2aa1844c1a3c8a30148d4884fcd359b3d00024242b4ad9486d988adeda78ca4f1490f762ccb166130a8ebf661a8ef46711d28d209e18ea76becf897e9
|
data/bin/diffux-compare
CHANGED
@@ -14,8 +14,24 @@ module Diffux
|
|
14
14
|
|
15
15
|
# @return [Hash]
|
16
16
|
def compare!
|
17
|
-
|
18
|
-
|
17
|
+
no_diff = {
|
18
|
+
diff_in_percent: 0,
|
19
|
+
diff_image: nil,
|
20
|
+
diff_clusters: []
|
21
|
+
}
|
22
|
+
|
23
|
+
# If these images are totally identical, we don't need to do any more
|
24
|
+
# work.
|
25
|
+
return no_diff if @png_before == @png_after
|
26
|
+
|
27
|
+
array_before = to_array_of_arrays(@png_before)
|
28
|
+
array_after = to_array_of_arrays(@png_after)
|
29
|
+
|
30
|
+
# If the arrays of arrays of colors are identical, we don't need to do any
|
31
|
+
# more work. This might happen if some of the headers are different.
|
32
|
+
return no_diff if array_before == array_after
|
33
|
+
|
34
|
+
sdiff = Diff::LCS.sdiff(array_before, array_after)
|
19
35
|
cluster_finder = DiffClusterFinder.new(sdiff.size)
|
20
36
|
sprite, all_comparisons = initialize_comparison_images(
|
21
37
|
[@png_after.width, @png_before.width].max, sdiff.size)
|
data/lib/diffux_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diffux-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Lencioni
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10-
|
12
|
+
date: 2015-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chunky_png
|