abroad 4.2.0 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fe36cd26c80451ce1514284dd1d4948797e8a95
4
- data.tar.gz: c1645f6188fc0494a51153bfb2a06ca4220b697f
3
+ metadata.gz: 0d961c2bc2ef6763471add263c02c5f0b6a76cef
4
+ data.tar.gz: dc3168e8415c94304b16afe1226b203272f9a1d5
5
5
  SHA512:
6
- metadata.gz: 9995680ee6439cad5c4d6086fa3efde9fcd9b12ffc2c8cf410d97aa5a6dca9539b0bcd49e1c66dd444045bed8c413098f90fa43dc205968e8588b5bd07ac7c5d
7
- data.tar.gz: e6609ea0b1c92ba0130db811f359e7aa48daf9659e787340bb671d952b0720fe1e25361c2690e2a425d7b32f41bc96d636cd50b2521037f0bdc8a75863dd09bf
6
+ metadata.gz: 6dae02b1c7729bbaea9879244b48465a5ccdad73c93fd3395b5ca95651b920443ea9b70a7355b56a2c93bc3930274c51b21a74186314998ded7574f7f7b46579
7
+ data.tar.gz: 9e86c2f06209ea62132d3ca25f78a922b9c7461610198e8a191f2b62827954bd5014d43a75a64319fda2dfba18d67738e5a23904f55cc1f2b660826e9ea7c97e
@@ -56,7 +56,7 @@ module Abroad
56
56
  # in double quotes
57
57
  unescape(
58
58
  strip_enclosing_quotes(
59
- builder.doc.xpath('/root/node()').to_xml.strip
59
+ builder.doc.children.first.children.map(&:to_xml).join.strip
60
60
  )
61
61
  )
62
62
  end
@@ -64,6 +64,8 @@ module Abroad
64
64
  def serialize(node, builder)
65
65
  if node.text?
66
66
  builder.text(unescape(node.text))
67
+ elsif node.cdata?
68
+ builder.cdata(node.text)
67
69
  else
68
70
  builder.send("#{node.name}_", node.attributes) do
69
71
  node.children.each do |child|
@@ -16,10 +16,8 @@ module Abroad
16
16
  private
17
17
 
18
18
  def parse
19
- Nokogiri::XML(stream) do |config|
20
- # don't allow network connections
21
- config.options = Nokogiri::XML::ParseOptions::NONET
22
- end
19
+ options = Nokogiri::XML::ParseOptions.new.default_xml.nonet
20
+ Nokogiri::XML(stream, nil, nil, options)
23
21
  end
24
22
  end
25
23
 
@@ -1,3 +1,3 @@
1
1
  module Abroad
2
- VERSION = '4.2.0'
2
+ VERSION = '4.2.1'
3
3
  end
@@ -2,7 +2,7 @@ require 'htmlentities'
2
2
 
3
3
  class HTMLEntities
4
4
  MAPPINGS['android_xml'] = MAPPINGS['xhtml1'].dup.tap do |mappings|
5
- mappings.delete('apos')
5
+ mappings.delete('apos') # single quote/apostrophe
6
6
  end
7
7
 
8
8
  FLAVORS << 'android_xml'
@@ -2,7 +2,7 @@ require 'htmlentities'
2
2
 
3
3
  class HTMLEntities
4
4
  MAPPINGS['android_xml'] = MAPPINGS['xhtml1'].dup.tap do |mappings|
5
- mappings.delete('apos')
5
+ mappings.delete('apos') # single quote/apostrophe
6
6
  end
7
7
 
8
8
  FLAVORS << 'android_xml'
@@ -52,3 +52,8 @@
52
52
  entities.xml:
53
53
  - key: states
54
54
  string: "Alaska & Washington"
55
+ cdata.xml:
56
+ - key: foobar
57
+ string: "Hello <![CDATA[<b>]]>beautiful<![CDATA[</b>]]> world!"
58
+ - key: bazboo
59
+ string: "<![CDATA[Hello <b>beautiful</b> world!]]>"
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <resources>
3
+ <string name="foobar">Hello <![CDATA[<b>]]>beautiful<![CDATA[</b>]]> world!</string>
4
+ <string name="bazboo"><![CDATA[Hello <b>beautiful</b> world!]]></string>
5
+ </resources>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abroad
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -149,6 +149,7 @@ files:
149
149
  - spec/extractors/xml/fixtures/basic_arrays.xml
150
150
  - spec/extractors/xml/fixtures/basic_plurals.xml
151
151
  - spec/extractors/xml/fixtures/basic_strings.xml
152
+ - spec/extractors/xml/fixtures/cdata.xml
152
153
  - spec/extractors/xml/fixtures/entities.xml
153
154
  - spec/extractors/xml/fixtures/markup.xml
154
155
  - spec/extractors/xml/fixtures/newlines.xml