rexle-diff 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -2
- data/lib/rexle-diff.rb +34 -21
- metadata +18 -18
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7608ce93f389f3eee77bf502df507d98db7ee7bb
|
4
|
+
data.tar.gz: b42d42b1a8dd41615da5be8a7dc8f1bbaabb2eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 762554af45b94f22e2758c2388a0224faacdf73695651609ccbdbef291e389058a656874616030e6ee08f689cefe63ab8e984f5f269e3870f2ee3d2bbf524bd2
|
7
|
+
data.tar.gz: 4ab322587b5fd5aa1599c205aca5b43a6d040487ff240e6ddb6abc98a6c3d1d10c9352d9a539f1809584abf005ca6400fa39457e00552c3cbdb19b390dd014b6
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
n������1��ߺsg�U�]������eU�Hñ��o�]���92��aȍi�!��s�rf�v�߭3Eu�/��EעC=��A� ���w����E ��P���~�J���q*z?ע(���x
|
1
|
+
������nJ�_4����.�p�os[��3稒{��������>��������m���M~&v��$�����=��S��,8�yl͡Z����������.�g���dR����D��B�#�fL��]é�fn�`eo�!\�@���t�o�����=9��ݰ2�3��XBQo��\;d��c�+����o^��kZh�k��oYx�y���b�mr�Wɞ�bZ�5JY�� �W����1�fS\�q�(���?\�
|
data/lib/rexle-diff.rb
CHANGED
@@ -21,34 +21,26 @@ class RexleDiff
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
# Returns an array of MD5 hashed strings representing each child node itself
|
25
|
-
#
|
26
|
-
def hashedxml(node)
|
27
|
-
|
28
|
-
node.elements.map do |element|
|
29
|
-
|
30
|
-
attributes = element.attributes.clone
|
31
|
-
|
32
|
-
# Although attribute last_modified isn't used by rexle-diff it is
|
33
|
-
# created by Dynarex whenever a record is created or updated.
|
34
|
-
# This would of course cause the record to be flagged as changed even
|
35
|
-
# when the element value itself hashn't changed.
|
36
|
-
#
|
37
|
-
%i(created last_modified).each {|x| attributes.delete x}
|
38
|
-
x = element.elements.length > 0 ? '' : 0
|
39
|
-
[element.name, attributes, element.text.to_s.strip, x].hash
|
40
|
-
|
41
|
-
end
|
42
|
-
end
|
43
24
|
|
44
25
|
|
45
26
|
# Returns an array of indexes of the nodes from the newer document which
|
46
27
|
# have been added or changed
|
47
28
|
#
|
48
29
|
def added(hxlist, hxlist2)
|
49
|
-
|
30
|
+
|
50
31
|
added_or_changed = hxlist2 - hxlist
|
51
|
-
|
32
|
+
|
33
|
+
n = hxlist2[0..-1].index added_or_changed.first
|
34
|
+
|
35
|
+
indexes = added_or_changed.inject([n]) do |r,x|
|
36
|
+
|
37
|
+
i = hxlist2[r.last+1..-1].index x
|
38
|
+
if i then
|
39
|
+
r << (r.last+1+i)
|
40
|
+
end
|
41
|
+
r
|
42
|
+
end
|
43
|
+
|
52
44
|
indexes
|
53
45
|
|
54
46
|
end
|
@@ -134,6 +126,27 @@ class RexleDiff
|
|
134
126
|
[added_indexes, updated_indexes]
|
135
127
|
end
|
136
128
|
|
129
|
+
|
130
|
+
# Returns an array of MD5 hashed strings representing each child node itself
|
131
|
+
#
|
132
|
+
def hashedxml(node)
|
133
|
+
|
134
|
+
node.elements.map.with_index do |element, i|
|
135
|
+
|
136
|
+
attributes = element.attributes.clone
|
137
|
+
|
138
|
+
# Although attribute last_modified isn't used by rexle-diff it is
|
139
|
+
# created by Dynarex whenever a record is created or updated.
|
140
|
+
# This would of course cause the record to be flagged as changed even
|
141
|
+
# when the element value itself hashn't changed.
|
142
|
+
#
|
143
|
+
%i(created last_modified).each {|x| attributes.delete x}
|
144
|
+
x = element.elements.length > 0 ? '' : 0
|
145
|
+
[i, element.name, attributes, element.text.to_s.strip, x].hash
|
146
|
+
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
137
150
|
# Returns an array of indexes from both original and new nodes which
|
138
151
|
# identifies which nodes did not change.
|
139
152
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexle-diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE2MTEyOTAxMzIwMVoXDTE3MTEyOTAxMzIwMVowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
ggEBANOCMfpspr6/pSs6JV45PdotRZor9jGEssh6y7HzHmbrBPnAZR5drknlzNOl
|
19
|
+
dsF9DQACJ42uGVVWjy6F+5ACPELuVhZ+QjCDf4yEknYPQdISyjDWoybrAI9Ugewm
|
20
|
+
mbnRaDs3WnVljvGmG9Kgm2f2R0Ft/aD7qYK3bkQuYYyNLSCGzrFgoRQmQQEdPTsO
|
21
|
+
wpyWyFYTPk1SfkX1P6R6gEx7XFIRgX5W7VPYRABfYVZjUM84rtHm5nYWnrxI6bM3
|
22
|
+
Q4hlc3BVOacUe1q7obCxqpb46kdzko/Q+OqaOw7I5scEIDDGhiLsOcOT/7Vrm6tW
|
23
|
+
LJF3T97SBMJ0Y4i8U3BcfxYddEUCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUfTz+OfPPy3C2A4MccZsMMD4/OIQwJgYDVR0RBB8w
|
25
25
|
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEArLGWVBmE
|
27
|
+
+I90pSB0GFI2T+S9IxszyDywY/ek8Gxqaj5+KduhpvlVocwbTzo98PGhYvaT+QrR
|
28
|
+
8xHRkInKWmD0XthW5vU+ABVO8rDmPtaFDhRcKI1T/TQ+AGmKyyX/e9rQONy1lUbd
|
29
|
+
7QsFvzxJaEjumpBxuVyZfsBqH/0XrsiMO4RVLo1Ett8F7xFR0inP64Q7U/IY45EL
|
30
|
+
boA8Q4V1SXXeTTYazitmgVASqf4KDHJVkd+vdNWyGUs3xP1hWL7bQrQsNC1qUIZG
|
31
|
+
q1Kd4dlPzOv4eViQtUu66H9or/lvOPWh/CmIReM06Ant7uX9HVEaRG7XDH9fPp5p
|
32
|
+
3j65mk5AS10weg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-11-29 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rexle
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.5.1
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: rexle-diff
|
metadata.gz.sig
CHANGED
Binary file
|