Hello,
today I noticed that if you have a file called filename.so.rb and you try to
require it without specifying the extension, MRI silently understands that
it isn't a .so file, will load the content and treat it as Ruby source.
# filename.so.rb
> puts __FILE__
> # somefile.rb
> require 'filename.so'
> # => /../../filename.so.rb
Other interpreters handle the case in a different way.
For example, JRuby won't load the file because it looks for a Ruby extension
in a file called filename.so.
See
http://jira.codehaus.org/browse/JRUBY-5569 I had a small chat with Charles Oliver Nutter (you can read the comments in
the JIRA ticket) and I'm curious to know if the way MRI works should be
considered a bug, a coincidence or a feature.
Thanks,
--
Simone Carletti
Application Developer
Site & Blog: http://www.simonecarletti.com
Email: wep...@weppos.net
LinkedIn: http://linkedin.com/in/weppos
Skype: weppos