rexml 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rexml might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/NEWS.md +27 -1
- data/README.md +2 -2
- data/lib/rexml/functions.rb +1 -4
- data/lib/rexml/parsers/baseparser.rb +4 -0
- data/lib/rexml/rexml.rb +1 -1
- data/lib/rexml/text.rb +4 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8154ea2369b6221818ab5eadd19d65464174dad7d4d1d63ab4b8b31ba475f701
|
4
|
+
data.tar.gz: 36e1512091b57d3724b379d77180ba715bb15e5d988c0f0aa129d78b662ae472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 883b2fbadd2d2967dae6eaf1285f518749cb995c0e8a5fa1ba7c644079e6e3acc49f6df108317b1d97cd03c84e074e0aba78bb259f0b658d27309cce78ba2a94
|
7
|
+
data.tar.gz: a0e1a2e4f7af8bfd6639929a7747d34e529783ffff986b0ae5e5d91b6ba10e5bfc07c2c5f9a387fea9632f1d4dddffcf9a04eabbcca91a2611e4c3dc83e7834b
|
data/NEWS.md
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
-
## 3.2.
|
3
|
+
## 3.2.1 - 2019-05-04 {#version-3-2-1}
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Improved error message.
|
8
|
+
[GitHub#12][Patch by FUJI Goro]
|
9
|
+
|
10
|
+
* Improved error message.
|
11
|
+
[GitHub#16][Patch by ujihisa]
|
12
|
+
|
13
|
+
* Improved documentation markup.
|
14
|
+
[GitHub#14][Patch by Alyssa Ross]
|
15
|
+
|
16
|
+
### Fixes
|
17
|
+
|
18
|
+
* Fixed a bug that `nil` variable value raises an unexpected exception.
|
19
|
+
[GitHub#13][Patch by Alyssa Ross]
|
20
|
+
|
21
|
+
### Thanks
|
22
|
+
|
23
|
+
* FUJI Goro
|
24
|
+
|
25
|
+
* Alyssa Ross
|
26
|
+
|
27
|
+
* ujihisa
|
28
|
+
|
29
|
+
## 3.2.0 - 2019-01-01 {#version-3-2-0}
|
4
30
|
|
5
31
|
### Fixes
|
6
32
|
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
We'll start with parsing an XML document
|
26
26
|
|
27
|
-
```
|
27
|
+
```ruby
|
28
28
|
require "rexml/document"
|
29
29
|
file = File.new( "mydoc.xml" )
|
30
30
|
doc = REXML::Document.new file
|
@@ -32,7 +32,7 @@ doc = REXML::Document.new file
|
|
32
32
|
|
33
33
|
Line 3 creates a new document and parses the supplied file. You can also do the following
|
34
34
|
|
35
|
-
```
|
35
|
+
```ruby
|
36
36
|
require "rexml/document"
|
37
37
|
include REXML # so that we don't have to prefix everything with REXML::...
|
38
38
|
string = <<EOF
|
data/lib/rexml/functions.rb
CHANGED
@@ -135,8 +135,7 @@ module REXML
|
|
135
135
|
#
|
136
136
|
# An object of a type other than the four basic types is converted to a
|
137
137
|
# string in a way that is dependent on that type.
|
138
|
-
def Functions::string( object
|
139
|
-
object = @@context[:node] if object.nil?
|
138
|
+
def Functions::string( object=@@context[:node] )
|
140
139
|
if object.respond_to?(:node_type)
|
141
140
|
case object.node_type
|
142
141
|
when :attribute
|
@@ -165,8 +164,6 @@ module REXML
|
|
165
164
|
object.to_s
|
166
165
|
end
|
167
166
|
end
|
168
|
-
when nil
|
169
|
-
""
|
170
167
|
else
|
171
168
|
object.to_s
|
172
169
|
end
|
@@ -335,6 +335,10 @@ module REXML
|
|
335
335
|
@nsstack.shift
|
336
336
|
last_tag = @tags.pop
|
337
337
|
md = @source.match( CLOSE_MATCH, true )
|
338
|
+
if md and !last_tag
|
339
|
+
message = "Unexpected top-level end tag (got '#{md[1]}')"
|
340
|
+
raise REXML::ParseException.new(message, @source)
|
341
|
+
end
|
338
342
|
if md.nil? or last_tag != md[1]
|
339
343
|
message = "Missing end tag for '#{last_tag}'"
|
340
344
|
message << " (got '#{md[1]}')" if md
|
data/lib/rexml/rexml.rb
CHANGED
data/lib/rexml/text.rb
CHANGED
@@ -137,7 +137,7 @@ module REXML
|
|
137
137
|
case c.ord
|
138
138
|
when *VALID_CHAR
|
139
139
|
else
|
140
|
-
raise "Illegal character #{c.inspect} in raw string
|
140
|
+
raise "Illegal character #{c.inspect} in raw string #{string.inspect}"
|
141
141
|
end
|
142
142
|
end
|
143
143
|
else
|
@@ -145,7 +145,7 @@ module REXML
|
|
145
145
|
case c.unpack('U')
|
146
146
|
when *VALID_CHAR
|
147
147
|
else
|
148
|
-
raise "Illegal character #{c.inspect} in raw string
|
148
|
+
raise "Illegal character #{c.inspect} in raw string #{string.inspect}"
|
149
149
|
end
|
150
150
|
end
|
151
151
|
end
|
@@ -154,13 +154,13 @@ module REXML
|
|
154
154
|
# context sensitive
|
155
155
|
string.scan(pattern) do
|
156
156
|
if $1[-1] != ?;
|
157
|
-
raise "Illegal character
|
157
|
+
raise "Illegal character #{$1.inspect} in raw string #{string.inspect}"
|
158
158
|
elsif $1[0] == ?&
|
159
159
|
if $5 and $5[0] == ?#
|
160
160
|
case ($5[1] == ?x ? $5[2..-1].to_i(16) : $5[1..-1].to_i)
|
161
161
|
when *VALID_CHAR
|
162
162
|
else
|
163
|
-
raise "Illegal character
|
163
|
+
raise "Illegal character #{$1.inspect} in raw string #{string.inspect}"
|
164
164
|
end
|
165
165
|
# FIXME: below can't work but this needs API change.
|
166
166
|
# elsif @parent and $3 and !SUBSTITUTES.include?($1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.7.6.2
|
126
127
|
signing_key:
|
127
128
|
specification_version: 4
|
128
129
|
summary: An XML toolkit for Ruby
|