phraseapp_updater 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phraseapp_updater.rb +1 -1
- data/lib/phraseapp_updater/differ.rb +5 -5
- data/lib/phraseapp_updater/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45e3b0d7a9b4211b1dbf7e568d3a4a5f5684c881b6f745d6d8576c7a75ef61a7
|
4
|
+
data.tar.gz: 88f20fb2fa95f07b9eaf35d4760873a259f85a884fde6d74b1323ef61698138c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 452a378d2ca304eda9dc0093634f6efeda587597f4a3a42357a3f6d0f956ba31c8900d4a3549ed3f6bcdc4c98d41d56994b68f917f3085f081a6573d25c11912
|
7
|
+
data.tar.gz: 6acd39998a5c485555e70a1f8aa52787ee16721fbc8f5d95ee0418b4af8e8b78a924b925d70d15fadd7942df9638ec79b6f413ae9aee4e216d9df852044d3c0b
|
data/lib/phraseapp_updater.rb
CHANGED
@@ -63,7 +63,7 @@ class PhraseAppUpdater
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def apply_diffs(hash, diffs)
|
66
|
-
deep_compact!(
|
66
|
+
deep_compact!(Hashdiff.patch!(hash, diffs))
|
67
67
|
end
|
68
68
|
|
69
69
|
def resolve!(original:, primary:, secondary:)
|
@@ -73,8 +73,8 @@ class PhraseAppUpdater
|
|
73
73
|
f_primary = flatten(primary)
|
74
74
|
f_secondary = flatten(secondary)
|
75
75
|
|
76
|
-
primary_diffs =
|
77
|
-
secondary_diffs =
|
76
|
+
primary_diffs = Hashdiff.diff(f_original, f_primary)
|
77
|
+
secondary_diffs = Hashdiff.diff(f_original, f_secondary)
|
78
78
|
|
79
79
|
# However, flattening discards one critical piece of information: when we
|
80
80
|
# have deleted or clobbered an entire prefix (subtree) from the original,
|
@@ -88,7 +88,7 @@ class PhraseAppUpdater
|
|
88
88
|
#
|
89
89
|
# Additionally calculate subtree prefixes that were deleted in `secondary`:
|
90
90
|
secondary_deleted_prefixes =
|
91
|
-
|
91
|
+
Hashdiff.diff(original, secondary, delimiter: SEPARATOR).lazy
|
92
92
|
.select { |op, path, from, to| (op == "-" || op == "~") && from.is_a?(Hash) && !to.is_a?(Hash) }
|
93
93
|
.map { |op, path, from, to| path }
|
94
94
|
.to_a
|
@@ -109,7 +109,7 @@ class PhraseAppUpdater
|
|
109
109
|
resolved_diffs.each { |d| STDERR.puts(d.inspect) }
|
110
110
|
end
|
111
111
|
|
112
|
-
|
112
|
+
Hashdiff.patch!(f_original, resolved_diffs)
|
113
113
|
|
114
114
|
expand(f_original)
|
115
115
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phraseapp_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Griffin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|