rspec_junit_formatter 0.3.0.pre4 → 0.3.0.pre5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rspec_junit_formatter.rb +28 -9
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca1245d6a6ab72821ed12421f83f5d19e160e150
|
4
|
+
data.tar.gz: 8adb046de7cfa63694143046bedbcff68e496637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27bf67f53a85bb7a352d0b2885e9a96f169cd28be692870a24848f04e1572ef3b7c0d0a53928b2a7ec8a709b79bbbc20c79c41090003579cfb2490d9c202a57b
|
7
|
+
data.tar.gz: bb2cdff147bacaa458925108244595bae509b1d26398a20b741d6057720d9759f479e8cefedff4e7bb9e80210126efa43e8f269bed5d3b8b1d4632eb1f953361
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -84,9 +84,28 @@ private
|
|
84
84
|
"]"
|
85
85
|
)
|
86
86
|
|
87
|
+
# Replace illegals with a Ruby-like escape
|
88
|
+
ILLEGAL_REPLACEMENT = Hash.new { |_, c|
|
89
|
+
x = c.ord
|
90
|
+
if x <= 0xff
|
91
|
+
"\\x%02X".freeze % x
|
92
|
+
elsif x <= 0xffff
|
93
|
+
"\\u%04X".freeze % x
|
94
|
+
else
|
95
|
+
"\\u{%X}".freeze % x
|
96
|
+
end.freeze
|
97
|
+
}.update(
|
98
|
+
"\0".freeze => "\\0".freeze,
|
99
|
+
"\a".freeze => "\\a".freeze,
|
100
|
+
"\b".freeze => "\\b".freeze,
|
101
|
+
"\f".freeze => "\\f".freeze,
|
102
|
+
"\v".freeze => "\\v".freeze,
|
103
|
+
"\e".freeze => "\\e".freeze,
|
104
|
+
).freeze
|
105
|
+
|
87
106
|
# Discouraged characters from https://www.w3.org/TR/xml/#charsets
|
88
107
|
# Plus special characters with well-known entity replacements
|
89
|
-
|
108
|
+
DISCOURAGED_REGEXP = Regexp.new(
|
90
109
|
"[" <<
|
91
110
|
"\u{22}" << # => "
|
92
111
|
"\u{26}" << # => &
|
@@ -116,17 +135,17 @@ private
|
|
116
135
|
)
|
117
136
|
|
118
137
|
# Translate well-known entities, or use generic unicode hex entity
|
119
|
-
|
120
|
-
?" => """.freeze,
|
121
|
-
|
122
|
-
?' => "'".freeze,
|
123
|
-
|
124
|
-
|
138
|
+
DISCOURAGED_REPLACEMENTS = Hash.new { |_, c| "&#x#{c.ord.to_s(16)};".freeze }.update(
|
139
|
+
?".freeze => """.freeze,
|
140
|
+
?&.freeze => "&".freeze,
|
141
|
+
?'.freeze => "'".freeze,
|
142
|
+
?<.freeze => "<".freeze,
|
143
|
+
?>.freeze => ">".freeze,
|
125
144
|
).freeze
|
126
145
|
|
127
146
|
def escape(text)
|
128
|
-
# Make sure it's utf-8,
|
129
|
-
text.to_s.encode(Encoding::UTF_8).gsub(ILLEGAL_REGEXP,
|
147
|
+
# Make sure it's utf-8, replace illegal characters with ruby-like escapes, and replace special and discouraged characters with entities
|
148
|
+
text.to_s.encode(Encoding::UTF_8).gsub(ILLEGAL_REGEXP, ILLEGAL_REPLACEMENT).gsub(DISCOURAGED_REGEXP, DISCOURAGED_REPLACEMENTS)
|
130
149
|
end
|
131
150
|
end
|
132
151
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|