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

Commits on Nov 9, 2014

  1. Copy the full SHA
    0a76d6c View commit details
  2. Fix bad merge.

    headius committed Nov 9, 2014
    Copy the full SHA
    12c9139 View commit details
Showing with 40 additions and 34 deletions.
  1. +11 −1 core/src/main/java/org/jruby/RubyRange.java
  2. +29 −33 spec/compiler/general_spec.rb
12 changes: 11 additions & 1 deletion core/src/main/java/org/jruby/RubyRange.java
Original file line number Diff line number Diff line change
@@ -279,7 +279,7 @@ public IRubyObject call(IRubyObject obj, boolean recur) {
}, value);
}

@JRubyMethod(name = {"inspect", "to_s"})
@JRubyMethod(name = "inspect")
public IRubyObject inspect(final ThreadContext context) {
RubyString i1 = ((RubyString) inspectValue(context, begin)).strDup(context.runtime);
RubyString i2 = (RubyString) inspectValue(context, end);
@@ -289,6 +289,16 @@ public IRubyObject inspect(final ThreadContext context) {
return i1;
}

@JRubyMethod(name = "to_s")
public IRubyObject to_s(final ThreadContext context) {
RubyString i1 = begin.asString().strDup(context.runtime);
RubyString i2 = end.asString();
i1.cat(isExclusive ? DOTDOTDOT : DOTDOT);
i1.append(i2);
i1.infectBy(i2);
return i1;
}

@JRubyMethod(name = "exclude_end?")
public RubyBoolean exclude_end_p() {
return getRuntime().newBoolean(isExclusive);
62 changes: 29 additions & 33 deletions spec/compiler/general_spec.rb
Original file line number Diff line number Diff line change
@@ -885,51 +885,47 @@ class JRUBY4925
expect(x).to eq Object
end
end
end
<<<<<<< HEAD
end
=======

it "retrieves toplevel constants with ::Const form" do
run '::Object' do |x|
expect(x).to eq Object
it "retrieves toplevel constants with ::Const form" do
run '::Object' do |x|
expect(x).to eq Object
end
end
end

it "splats arguments to super" do
run '
class SplatSuperArgs0
def foo(a, b, c)
a + b + c
it "splats arguments to super" do
run '
class SplatSuperArgs0
def foo(a, b, c)
a + b + c
end
end
end
class SplatSuperArgs1 < SplatSuperArgs0
def foo(*args)
super(*args)
class SplatSuperArgs1 < SplatSuperArgs0
def foo(*args)
super(*args)
end
end
SplatSuperArgs1.new.foo(1, 2, 3)' do |x|
expect(x).to eq 6
end
SplatSuperArgs1.new.foo(1, 2, 3)' do |x|
expect(x).to eq 6
end
end

it "performs super calls within a closure" do
run '
class SplatSuperArgs0
def foo(a)
a
it "performs super calls within a closure" do
run '
class SplatSuperArgs0
def foo(a)
a
end
end
end
class SplatSuperArgs1 < SplatSuperArgs0
def foo(a)
1.times do
super(a)
class SplatSuperArgs1 < SplatSuperArgs0
def foo(a)
1.times do
super(a)
end
end
end
SplatSuperArgs1.new.foo(1)' do |x|
expect(x).to eq 1
end
SplatSuperArgs1.new.foo(1)' do |x|
expect(x).to eq 1
end
end
end
>>>>>>> master