pump 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -1
- data/lib/pump/version.rb +1 -1
- data/lib/pump/xml.rb +2 -2
- data/spec/pump/xml_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94ff0f5cef6e535be8d383cbdc0894ad6cad3247
|
4
|
+
data.tar.gz: d7ace652091d3ce66eced7bbcf69438998a4abc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c35d78070528961c1509f5cd2ea3d9738077b41046240bbc82c7b454561ea51df1a1cc2841f64ef43f22a2e2aabccbf8c212d8f6671b6901b24fb849b89faefd
|
7
|
+
data.tar.gz: d8f8e432d713bf988ecd9484897e24df93b0eab3c40bff501e4fb6ac3b1b5cf1fc22f1f8c707f5f54b0a896a8cba8560697505dbee2f0142892490311846dcee
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
### dev
|
2
2
|
|
3
|
-
[full changelog](http://github.com/yolk/pump/compare/v0.6.
|
3
|
+
[full changelog](http://github.com/yolk/pump/compare/v0.6.6...master)
|
4
|
+
|
5
|
+
### 0.6.6 / 2014-07-03
|
6
|
+
|
7
|
+
[full changelog](http://github.com/yolk/valvat/compare/v0.6.5...v0.6.6)
|
8
|
+
|
9
|
+
* XML: Remove ilegal chars from string values also on multiple line strings
|
4
10
|
|
5
11
|
### 0.6.5 / 2014-07-03
|
6
12
|
|
data/lib/pump/version.rb
CHANGED
data/lib/pump/xml.rb
CHANGED
@@ -69,7 +69,7 @@ module Pump
|
|
69
69
|
(0x10000..0x10FFFF)
|
70
70
|
]
|
71
71
|
|
72
|
-
VALID_XML_CHARS = Regexp.new('
|
72
|
+
VALID_XML_CHARS = Regexp.new('\A['+
|
73
73
|
VALID_CHAR.map { |item|
|
74
74
|
case item
|
75
75
|
when Fixnum
|
@@ -78,7 +78,7 @@ module Pump
|
|
78
78
|
[item.first, '-'.ord, item.last].pack('UUU').force_encoding('utf-8')
|
79
79
|
end
|
80
80
|
}.join +
|
81
|
-
']
|
81
|
+
']*\Z')
|
82
82
|
|
83
83
|
def remove_ilegal_chars(string)
|
84
84
|
return string if !string.is_a?(String) || string =~ VALID_XML_CHARS
|
data/spec/pump/xml_spec.rb
CHANGED
@@ -15,10 +15,10 @@ describe Pump::Xml do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
context "with ilegal chars" do
|
18
|
-
let(:person) { Struct.new(:name, :age, :last_name).new("Benny
|
18
|
+
let(:person) { Struct.new(:name, :age, :last_name).new("Benny\n\u001APenny", 9, "Hellman") }
|
19
19
|
|
20
20
|
it "returns xml string" do
|
21
|
-
xml.encode(person).should eql("#{XML_INSTRUCT}<person>\n <name>Benny
|
21
|
+
xml.encode(person).should eql("#{XML_INSTRUCT}<person>\n <name>Benny\nPenny</name>\n</person>\n")
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|