rexle 1.3.8 → 1.3.9

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: 2fc36855866c72221df70768e41758292d1474f9
4
- data.tar.gz: 208b90bbcdb53495e890841a0f516da70c2e109d
3
+ metadata.gz: 7e887ca995f85512cd44dfb3803f2cd94a354470
4
+ data.tar.gz: e6156c54b67174055fccd6a519dbfb82bd0eec5a
5
5
  SHA512:
6
- metadata.gz: ae378addce43d6ba6d3a02b139a603dca0dd3b8ec2722b9dd5f87a164c7fb4dc68cfb8563bf9b41759b95da131d4e88d982afef4d0ecee1a94dad4b8d982aad0
7
- data.tar.gz: c49f6ece287e361184c0dd7b8d1bfca2535c39cfc4ed260eef268228d632aaa26bb87a9d13a95ead89b4d2dcaa72de11f481db7a08542fa41462d0d3e2fc1261
6
+ metadata.gz: df2c07a7f7b698dc7f1f33f2dffbae3dcf635f5ccb7ab3910f4e7daf656dbe67af1c7f3fb59914d71a82a9181d4de109aee5f722840977928614ac1c10182fd5
7
+ data.tar.gz: cfc04148dafb882bf53ee785a542360f32850475819fb77ff947b7306cb39c95e4695cdf963035a06feea3406cdc21f1d04f97735b032dc6211ecf61ece7c457
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle.rb CHANGED
@@ -12,6 +12,8 @@ require 'backtrack-xpath'
12
12
 
13
13
  # modifications:
14
14
 
15
+ # 05-Nov-2015: bug fix: UTF-8 encoding is now enforced when
16
+ # preparing the XML for output
15
17
  # 15-Sep-2015: improvement: When handling the HTML element textarea, it
16
18
  # is no longer printed as a self-closing tag
17
19
  # 25-May-2015: bug fix: If a Polyrex XML string is being parsed then the
@@ -164,7 +166,8 @@ module XMLhelper
164
166
  def doc_print(children, declaration=true)
165
167
 
166
168
  body = (children.nil? or children.empty? \
167
- or children.is_an_empty_string? ) ? '' : scan_print(children).join
169
+ or children.is_an_empty_string? ) ? '' : \
170
+ scan_print(children).join.force_encoding("utf-8")
168
171
 
169
172
  a = self.root.attributes.to_a.map do |k,v|
170
173
  "%s='%s'" % [k,(v.is_a?(Array) ? v.join(' ') : v.to_s)]
@@ -211,9 +214,9 @@ module XMLhelper
211
214
 
212
215
  def scan_print(nodes)
213
216
 
214
- nodes.map do |x|
215
-
216
- if x.is_a? Rexle::Element then
217
+ r2 = nodes.map do |x|
218
+
219
+ r = if x.is_a? Rexle::Element then
217
220
 
218
221
  a = x.attributes.to_a.map do |k,v|
219
222
  "%s='%s'" % [k,(v.is_a?(Array) ? v.join(' ') : v)]
@@ -227,6 +230,7 @@ module XMLhelper
227
230
 
228
231
  out = ["<%s>" % tag]
229
232
  out << scan_print(x.children)
233
+
230
234
  out << "</%s>" % x.name
231
235
  else
232
236
  out = ["<%s/>" % tag]
@@ -237,7 +241,11 @@ module XMLhelper
237
241
  elsif x.is_a? Rexle::Comment then x.print
238
242
 
239
243
  end
244
+
245
+ r
240
246
  end
247
+
248
+ r2
241
249
 
242
250
  end
243
251
 
@@ -1018,6 +1026,7 @@ class Rexle
1018
1026
  end
1019
1027
 
1020
1028
  def xml(options={})
1029
+
1021
1030
  h = {
1022
1031
  Hash: lambda {|x|
1023
1032
  o = {pretty: false}.merge(x)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  Tkua07gB3/nVO3aPg7C3vEbDZCxT3WAMli2uZisYT6ozmdAlDsixLjipgFN4If3z
32
32
  Ej0QR3kvGcAvFQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-10-11 00:00:00.000000000 Z
34
+ date: 2015-11-05 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexleparser
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ��������v1i�<��E#dͫ�,�e~��?�¨� ۦ!_J0iGd���S�g:�f�l��=)�t��
2
- %�W|� �%���N�զ�$U���b���g�����ND�,�ӸY� 0���,N�u��� ;���@4�Ѫ��m�O��p���Jb�p����ϥ�Z�vl��������Hu��$&�3ԗ�$p��s�ظqc�~D�����#E��j굸P�>Խqﶊ�d.;50ao�۩^�
1
+ �{Oa�T���)�A@,���;��+
2
+ ��� ֨nx+ZIW�������D�%U͈!�/w��Fc�ƽ�<[`�����"4Q�Kc��o,����ۻ5��t�$1ʛnv��*�d���tjV���$��:^��~�H��J0�qYH��7$�� �hߵ�[�fh���P��1�=�޲n����D�˅�����dR�Ȫ�
3
+ ��3/��S������+�2>�X