jrexml 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.5.2
2
+
3
+ * Raise REXML::ParseException on parse errors, instead of a custom error.
4
+
1
5
  = 0.5.1
2
6
 
3
7
  * Fix an issue that allows JREXML to work with REXML::Source and stream parsing.
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.1") do |p|
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 XmlParsingError, e.message
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
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: jrexml
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.1
6
+ version: 0.5.2
7
7
  date: 2007-08-08 00:00:00 -07:00
8
8
  summary: JREXML speeds up REXML under JRuby by using a Java pull parser.
9
9
  require_paths: