MRI 1.9.2 ENV is not a Hash while JRuby's is
--------------------------------------------
Key: JRUBY-5847
URL: http://jira.codehaus.org/browse/JRUBY-5847
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.6.2
Environment: java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
Reporter: François Beausoleil
Assignee: Thomas E Enebo
Priority: Minor
When I require "active_support/core_ext/hash/slice" from JRuby and 1.9.2, I get
different behavior:
Gist: https://gist.github.com/1006863
{noformat}
$ rvm jruby-head ruby gem list -l activesupport
*** LOCAL GEMS ***
activesupport (3.0.7)
$ rvm jruby-head ruby irb -ractive_support/core_ext/hash/slice
no such file to load -- bond
jruby-head :001 > ENV.slice("A")
=> {}
$ rvm 1.9.2-p180 ruby gem list -l activesupport
*** LOCAL GEMS ***
activesupport (3.0.7, 3.0.6, 3.0.5, 3.0.4)
$ rvm 1.9.2-p180 ruby irb -ractive_support/core_ext/hash/slice
> ENV.slice("A")
NoMethodError: undefined method `slice' for #<Object:0x00000100890e30>
from (irb):1
from /Users/francois/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
{noformat}
I don't know which implementation is "wrong" here. RubySpec is silent about the
implementation of ENV, which is at it should be: it's a minor implementation
detail.
I hit this when I made a configuration management routine where I was sending
ENV to a method that expected a Hash-like object, and called #slice on it.
Under 1.9.2, my specs failed, while under JRuby they passed.
--
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