jrexml 0.5 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.5.1
2
+
3
+ * Fix an issue that allows JREXML to work with REXML::Source and stream parsing.
4
+
1
5
  = 0.5
2
6
 
3
7
  * Birthday!
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") do |p|
8
+ hoe = Hoe.new("jrexml", "0.5.1") do |p|
9
9
  p.rubyforge_name = "caldersphere"
10
10
  p.url = "http://caldersphere.rubyforge.org/jrexml"
11
11
  p.author = "Nick Sieger"
@@ -41,8 +41,9 @@ module JREXML
41
41
  end
42
42
 
43
43
  def stream=(source)
44
+ enc = source.encoding if source.respond_to?(:encoding)
44
45
  @source = JavaPullParser.factory.newPullParser
45
- @source.setInput java.io.ByteArrayInputStream.new(get_bytes(source)), nil
46
+ @source.setInput java.io.ByteArrayInputStream.new(get_bytes(source)), enc
46
47
  end
47
48
 
48
49
  # Returns true if there are no more events
@@ -156,6 +157,7 @@ module JREXML
156
157
  end
157
158
 
158
159
  def get_bytes(src)
160
+ src = src.buffer if src.respond_to?(:buffer) # REXML::Source crap
159
161
  string = if src.respond_to?(:read)
160
162
  src.read
161
163
  else
@@ -96,4 +96,8 @@ XML
96
96
  parse_and_verify f.read
97
97
  end
98
98
  end
99
+
100
+ it "should handle a REXML::Source argument" do
101
+ parse_and_verify REXML::SourceFactory.create_from("<document/>")
102
+ end
99
103
  end
metadata CHANGED
@@ -3,8 +3,8 @@ 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"
7
- date: 2007-08-07 00:00:00 -07:00
6
+ version: 0.5.1
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:
10
10
  - lib