rexleparser 0.5.9 → 0.5.10

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: 8258d5d421fa3d0fc502c413c7ed1c5c2be927d8
4
- data.tar.gz: be193636ca0e679cab459437f36f04e20f59a5a1
3
+ metadata.gz: a8c6e0c98ab82d9ab25998d70a80ab85205e69fe
4
+ data.tar.gz: ca60e2d6f97490342287be767ca6507822880511
5
5
  SHA512:
6
- metadata.gz: b85289de149d1a78ab742214a92a73b39b75ac50518e8da70c6e1e740b7abeb3239d928a9ce306351750e0aa6fbdb5b74b68b15a95626748b9cef73a0a27af21
7
- data.tar.gz: a085d0aaa231a3c2b45c8aaa0f3fcfaaa6b6853571e192fd475e6fa622f5dd7992a2291cf2b19134cb7abd17b27745cb5cc739407728e87a179bc54b678a0b7f
6
+ metadata.gz: eade36dcc002807e18bd07357b695f5b8bb8c95499a9f5ce91d58b34ff80793e0863a1fe4e4187baed922890f5526cc21221362ed5ea28c1d8b42de6628d8472
7
+ data.tar.gz: f62d6271b8d4c33cc0a65c090a66712ddcc03a32e34a8f77c28508399e5c24139a1a62ea737499152c82b6c25a64574cac93689d24b2736bafb4c1dba7795778
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rexleparser.rb CHANGED
@@ -24,13 +24,16 @@ class RexleParser
24
24
 
25
25
  def scan_next(r, tagname)
26
26
 
27
+ #puts '+scan_next : ' + r.inspect
28
+
27
29
  j = tagname
28
30
 
29
31
  if r[0] == '>' then
30
32
 
31
33
  # end tag match
32
34
  tag = r[/^>[^<]+</]
33
-
35
+ #puts 'tag: ' + tag.inspect
36
+
34
37
  if tag[1][/[ \w"']/] and tag[-2] != '/' then
35
38
 
36
39
  # is it the end tag to match the start tag?
@@ -57,7 +60,7 @@ class RexleParser
57
60
 
58
61
  return [:child, text]
59
62
  end
60
- elsif tag[/>\/|\/<$/] then
63
+ elsif tag[/>\/|\/<$/] or tag[/^>.*[\w!]+\/<$/] then
61
64
  return [:newnode]
62
65
  elsif r[/^(?:>--|>\]\]).*(?:--!|\[ATADC\[!<)/m] then
63
66
 
@@ -69,8 +72,12 @@ class RexleParser
69
72
  return [:child, create_comment(tag)]
70
73
  else
71
74
 
72
- # it's a start tag?
73
- return [:newnode] if tag[/^>.*[\w!]+\/<$/]
75
+ r.sub!('>',';tg&')
76
+
77
+ i = r =~ />(?:[\-\/"'\w]|\]\])/ # collect until a tag is found or a CDATA element
78
+ text = r.slice!(0,i)
79
+
80
+ return [:child, text] if text
74
81
 
75
82
  end # end of tag match
76
83
 
@@ -96,6 +103,7 @@ class RexleParser
96
103
 
97
104
  def parse_node(r, j=nil)
98
105
 
106
+ #puts '+parse_node ' + r.inspect
99
107
  return unless r.length > 0
100
108
 
101
109
  tag = r.slice!(/^>[^<]+</) if (r =~ /^>[^<]+</) == 0
@@ -122,6 +130,7 @@ class RexleParser
122
130
  until end_tag do
123
131
 
124
132
  key, res = scan_next r, tagname
133
+ #puts "key: %s; res: %s" % [key, res]
125
134
 
126
135
  case key
127
136
  when :end_tag
@@ -163,7 +172,7 @@ class RexleParser
163
172
  obj = raw_obj.clone
164
173
  return obj.reverse! if obj.is_a? String
165
174
 
166
- tag = obj.pop.reverse.sub('!cdata','!-')
175
+ tag = obj.pop.reverse
167
176
 
168
177
  children = obj[-1]
169
178
 
data.tar.gz.sig CHANGED
@@ -1 +1,4 @@
1
- tu_&��A_b�>$�e��v[ pp+��c<4i0wL�VG�ʾ���NmY�����`�ѵ��a�J���Ѧا�˚A�� Өuk�_6���u(d��ݷMu�Is<ơj�]�?R(4�E����株-R9L�^n8�p@фJv_��ku�A�.�r�C�+�����������&Tߏ�pWx7�ǯ��Ӥ]�i�ls�c.h!�{JLZ4��>�օ4���>c*�=8G����>G�a�z�
1
+ )XfbVʰ����CU���q���3�w�#�eq>�H��� 1�����U�8S��Z���+��n9��^��L|�
2
+ a4��2ci����"o��؀�dV��y��?U�*:j���{$�Dm
3
+ ��5�����ٕ׵��/��Q����l�,\@��3:4E�5J��!��Q.`��ov`Y�q����
4
+ ��6u�1� �p9o9e죭�<�����QA  4,�F�:�o���蠞����/��\Q
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexleparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  CkjTMLaPwIQI6dsbG4bVJ7/XzL7c8niqJSF7M0yr1+2kUrWFUZMBMrUUxgZxSkjL
32
32
  Cgd76bp2zjiyCw==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-01-30 00:00:00.000000000 Z
34
+ date: 2015-01-31 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
metadata.gz.sig CHANGED
Binary file