JRuby and Builder::XmlMarkup (strange File interaction)
-------------------------------------------------------
Key: JRUBY-2475
URL: http://jira.codehaus.org/browse/JRUBY-2475
Project: JRuby
Issue Type: Bug
Components: Application Error
Affects Versions: JRuby 1.1.1
Environment: Windows Vista
Reporter: Nivaldo Fernandes
There is a seemingly puzzling interaction between JRuby and Builder
(http://builder.rubyforge.org/). I have no problems using JRuby to use Ruby's
File class but after I instantiate Builder with the following code,
xml = Builder::XmlMarkup.new( :target => File.open(ARGV[2], "w"), :indent => 4 )
xml.instruct! :xml, :version => "1.0", :encoding => "US-ASCII"
, where ARGV[2] is the name of the output xml file,
there is simply no output sent to the file...blank, it will just not work...
I have tried using the technique of instantiating a Java File as the target for
Builder but it does not like it because it writes to the file using the <<
sugar syntax:
C:/jruby-1.1.1/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlmarkup.rb:277
:in `_special': undefined method `<<' for #<Java::JavaIo::File:0x84f566
@java_object=PITest.xml\w> (NoMethodError)
from
C:/jruby-1.1.1/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlmarkup.rb:244:in
`instruct!'
from buildpixml.rb:101
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email