jrexml 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/jrexml/java_pull_parser.rb +2 -3
- data/spec/java_pull_parser_spec.rb +4 -0
- metadata +1 -1
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", "LICENSE.txt",
|
|
5
5
|
|
6
6
|
begin
|
7
7
|
require 'hoe'
|
8
|
-
hoe = Hoe.new("jrexml", "0.5.
|
8
|
+
hoe = Hoe.new("jrexml", "0.5.2") do |p|
|
9
9
|
p.rubyforge_name = "caldersphere"
|
10
10
|
p.url = "http://caldersphere.rubyforge.org/jrexml"
|
11
11
|
p.author = "Nick Sieger"
|
@@ -28,8 +28,6 @@ module JREXML
|
|
28
28
|
|
29
29
|
ADJACENT_EVENTS = [TEXT, ENTITY_REF]
|
30
30
|
|
31
|
-
class XmlParsingError < StandardError; end
|
32
|
-
|
33
31
|
module JavaPullParser
|
34
32
|
def self.factory
|
35
33
|
@factory ||= proc do
|
@@ -43,6 +41,7 @@ module JREXML
|
|
43
41
|
def stream=(source)
|
44
42
|
enc = source.encoding if source.respond_to?(:encoding)
|
45
43
|
@source = JavaPullParser.factory.newPullParser
|
44
|
+
def @source.buffer; ""; end # In case REXML tries to call #buffer on our source
|
46
45
|
@source.setInput java.io.ByteArrayInputStream.new(get_bytes(source)), enc
|
47
46
|
end
|
48
47
|
|
@@ -150,7 +149,7 @@ module JREXML
|
|
150
149
|
begin
|
151
150
|
@event_stack << @source.nextToken
|
152
151
|
rescue NativeException => e
|
153
|
-
raise
|
152
|
+
raise REXML::ParseException, e.message
|
154
153
|
end
|
155
154
|
end
|
156
155
|
@event_stack
|
@@ -100,4 +100,8 @@ XML
|
|
100
100
|
it "should handle a REXML::Source argument" do
|
101
101
|
parse_and_verify REXML::SourceFactory.create_from("<document/>")
|
102
102
|
end
|
103
|
+
|
104
|
+
it "should raise a REXML::ParseException on malformed XML" do
|
105
|
+
lambda { parse_and_verify "<div>at&t" }.should raise_error(REXML::ParseException)
|
106
|
+
end
|
103
107
|
end
|
metadata
CHANGED