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: f5ef5acd895a
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6df79ee5d530
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 7, 2018

  1. Alias Set#to_s to inspect

    to support Ruby 2.5 and stated in this feature https://bugs.ruby-lang.org/issues/13676.
    ruby/ruby@d893c12.
    #4876.
    ChrisBr committed Jan 7, 2018
    Copy the full SHA
    0cefb4c View commit details

Commits on Jan 8, 2018

  1. Merge pull request #4950 from ChrisBr/feature/set-to-s

    Alias Set#to_s to inspect
    enebo authored Jan 8, 2018
    Copy the full SHA
    6df79ee View commit details
Showing with 14 additions and 1 deletion.
  1. +1 −1 core/src/main/java/org/jruby/ext/set/RubySet.java
  2. +13 −0 spec/ruby/core/set/to_s_spec.rb
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ext/set/RubySet.java
Original file line number Diff line number Diff line change
@@ -1080,7 +1080,7 @@ public final IRubyObject inspect() {

// Returns a string containing a human-readable representation of the set.
// e.g. "#<Set: {element1, element2, ...}>"
@JRubyMethod(name = "inspect")
@JRubyMethod(name = "inspect", alias = "to_s")
public RubyString inspect(ThreadContext context) {
final Ruby runtime = context.runtime;

13 changes: 13 additions & 0 deletions spec/ruby/core/set/to_s_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require File.expand_path('../shared/inspect', __FILE__)
require 'set'

ruby_version_is "2.5" do
describe "Set#to_s" do
it_behaves_like :set_inspect, :to_s

it "is an alias of inspect" do
set = Set.new
set.method(:to_s).should == set.method(:inspect)
end
end
end