On Sat, 19 Jun 2004, Steve Drach defenestrated me:
>
> I'm trying to use JDOM and JRuby (yes I know about RexML).  In the following
> program, I get an error when I pass f to sb.build because f is a RubyFile and
> not a Java File object. The error I get is:
> 
> no method 'build' with argument types matching [org.jruby.RubyFile] 
> (NameError) 
> 
> What is the correct way to deal with this, I believe, common issue?

  Well one way is to create a 'java_alias' ala:

java_alias :JFile, :File

  then use 'JFile.new "/etc/blah"'

  I actually think that your original code should have worked, but
it doesn't.  In ruby:

module One
  class File
    def initialize(a, b)
    end
  end
end

Class Two
  include One

  def foo
    p File.new("/etc/motd", "r")
  end
end

  Will see One::File instead of File.  At the surface I would think
that include_package should work similiarly.  I will likely change this
behavior before next release unless someone can explain why doing so 
would be a bad idea.

-Tom

-- 
+ http://www.tc.umn.edu/~enebo +---- mailto:enebo / acm.org ----+
| Thomas E Enebo, Protagonist  | "A word is worth a thousand  |
|                              |  pictures" -Bruce Tognazzini |