Able to require pathname?

For better or worse, this appears to be what 1.9 can do currently

a = Pathname.new ‘/a/b/c’
=> #Pathname:/a/b/c

require a
LoadError: no such file to load – /a/b/c
from (irb):3:in require' from (irb):3 from C:/installs/ruby-1.9.1-p243-tweaked/bin/irb.bat:20:in

a.to_s
=> “/a/b/c”

a.to_str
NoMethodError: undefined method to_str' for #<Pathname:/a/b/c> from (irb):5 from C:/installs/ruby-1.9.1-p243-tweaked/bin/irb.bat:20:in

which jruby --1.9 doesn’t do–able to require pathnames.

I’m not sure what’s going on here.
Is this a bug?
Thanks.
-r

Hi Roger,

Yes, this is a bug in JRuby’s 1.9 mode. MRI 1.9 changed require’s
behavior so that it uses to_path() to convert objects to strings, not
to_str(), as it was in 1.8.

Please file the bug against JRuby’s “Ruby 1.9” component.

Thanks,
–Vladimir

On Sat, Nov 28, 2009 at 1:58 AM, Roger P. [email protected]
wrote:

`’

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

OK, I’ve filed http://jira.codehaus.org/browse/JRUBY-4284 for this,
and it should be fixed by now, along with new RubySpecs for calling
#to_path and #to_str.

Thanks,
–Vladimir

On Sat, Nov 28, 2009 at 1:58 AM, Roger P. [email protected]
wrote:

`’

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email