Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e8735f23408f
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 411ca6a526a5
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 6, 2015

  1. Copy the full SHA
    dc3e1ca View commit details
  2. Copy the full SHA
    411ca6a View commit details
Showing with 11 additions and 0 deletions.
  1. +6 −0 core/src/main/java/org/jruby/RubyGlobal.java
  2. +5 −0 spec/ruby/core/env/shared/to_hash.rb
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/RubyGlobal.java
Original file line number Diff line number Diff line change
@@ -350,6 +350,12 @@ public IRubyObject to_s(){
return getRuntime().newString("ENV");
}

@JRubyMethod
public RubyHash to_h(){
return to_hash();
}


}

/**
5 changes: 5 additions & 0 deletions spec/ruby/core/env/shared/to_hash.rb
Original file line number Diff line number Diff line change
@@ -16,4 +16,9 @@
ENV.send(@method).values.all? {|v| v.encoding == Encoding.find('locale') }.should be_true
end
end

it "duplicates the ENV when converting to a Hash" do
h = ENV.send(@method)
h.object_id.should_not == ENV.object_id
end
end