rexle-diff 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a445923bbadcdd93d60a93fc7811a04dbfbde01a
4
- data.tar.gz: ad7bd6e25eb12f5f5dadacf988b3167886035db9
3
+ metadata.gz: 488532780f1984da6402b6536b22cf48cf491c64
4
+ data.tar.gz: 2a44f6adc4b8cdc531566a4ca5124e02ed2e8692
5
5
  SHA512:
6
- metadata.gz: cf5a4a26c39e493f6029acb1cf99d3ba257132ad96746263c5acbda305394e580599da1bd6fad096c40b36c1e103597c9bef5da70d4310a61db88572eadbfc8c
7
- data.tar.gz: 3e2026f0489e014cede4b7b9c4fdbd21197c7aa0956858035ce3182bfb9fa38dffd8e2ba9820c640b33d8db6821a0a88a558d150a4912bda8e0712d30b49762a
6
+ metadata.gz: 52f7b4687929c2a2e5b826703a96210a1adf20663e36478d6768668dfd0202ea3a2fd7720072bf820ddc8595e7a8be6fff424c16b703c3c228fb201ff9b02eb7
7
+ data.tar.gz: 5e4659984642b2ff9e9932874f7dd8c2de86f035ac20baccfbcd8daa3b061192700baf46d934ba3e5ff3dcf0d0ef4775efd7b63cd5b317abe4bbf4a00ee64907
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -3,6 +3,7 @@
3
3
  # file: rexle-diff.rb
4
4
 
5
5
  require 'rexle'
6
+ require 'fuzzy_match'
6
7
 
7
8
 
8
9
  class RexleDiff
@@ -60,8 +61,28 @@ class RexleDiff
60
61
 
61
62
  # elements which may have been modified are also
62
63
  # added to the added_indexes list
63
- added_indexes = added(hxlist, hxlist2)
64
+ added_or_changed_indexes = added(hxlist, hxlist2)
65
+
66
+ # is the added index item a new entry or an entry modification?
67
+ updated_indexes, added_indexes = added_or_changed_indexes.partition do |i|
68
+
69
+ e1 = node.elements[i+1]
70
+ next unless e1
71
+
72
+ fm = FuzzyMatch.new [e1.text]
73
+ result, score1, score2 = fm.find_with_score node2.elements[i+1].text
74
+ #puts "result: %s score1: %s score2: %s" % [result, score1, score2]
75
+
76
+ result and score1 >= 0.5
77
+
78
+ end
64
79
 
80
+
81
+ updated_indexes.each do |i|
82
+ attributes = node2.elements[i+1].attributes
83
+ attributes[:last_modified] = Time.now.to_s
84
+ end
85
+
65
86
  added_indexes.each do |i|
66
87
 
67
88
  attributes = node2.elements[i+1].attributes
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.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -53,6 +53,26 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 1.2.24
56
+ - !ruby/object:Gem::Dependency
57
+ name: fuzzy_match
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '2.1'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 2.1.0
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '2.1'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 2.1.0
56
76
  description:
57
77
  email: james@r0bertson.co.uk
58
78
  executables: []
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- f ��;�J��6���|�!жx�Xg��zS`��oK���UM�/��OQɞ���O�=��Џ�4\���t��9 s &�>K�����%�/��ߵ����a
2
- ��"v�� ]�w%o'��E�����5]1Yl0�<�����Z:N��3�����]�D*=P!Kz�_��q�����t�8�Er�P�V�1{�9�ݷq{��F��
1
+ I떈JPp4o����/+�U�_��0�[ � ?<��lū��p��2�бі}��}R|F_1Ŀ|,w�P�.���uA�7z&�����MF�5H��.]�&$��?�/�i���}� 4���`@�7��c�4�€��M� �9�}Z5BM��2��ʝ�]��H��ɹ�&R�fw���'V�yz~�g���s��@�&V3?�ʄPQ�,��*ł^�U?n˾k�λ:?��F_
2
+  ��2������6����y!_��