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

Commits on Oct 13, 2015

  1. Copy the full SHA
    f313270 View commit details
  2. Copy the full SHA
    991a4a5 View commit details
  3. Copy the full SHA
    9e7b589 View commit details
  4. 4
    Copy the full SHA
    6a52113 View commit details
Original file line number Diff line number Diff line change
@@ -96,4 +96,8 @@ public Signature getSignature() {
public ArgumentDescriptor[] getArgumentDescriptors() {
return proc.getBlock().getBody().getArgumentDescriptors();
}

public RubyProc getProc() {
return proc;
}
}
Original file line number Diff line number Diff line change
@@ -912,7 +912,7 @@ public static IRubyObject classSuperSplatArgs(ThreadContext context, IRubyObject

@Interp
public static IRubyObject classSuper(ThreadContext context, IRubyObject self, String methodName, RubyModule definingModule, IRubyObject[] args, Block block) {
RubyClass superClass = definingModule.getMetaClass().getSuperClass();
RubyClass superClass = definingModule.getMetaClass().getMethodLocation().getSuperClass();
DynamicMethod method = superClass != null ? superClass.searchMethod(methodName) : UndefinedMethod.INSTANCE;
IRubyObject rVal = method.isUndefined() ? Helpers.callMethodMissing(context, self, method.getVisibility(), methodName, CallType.SUPER, args, block)
: method.call(context, self, superClass, methodName, args, block);
14 changes: 4 additions & 10 deletions core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.regex.Pattern;

/**
* Encapsulated logic for processing JRuby's command-line arguments.
@@ -78,6 +79,8 @@ public String toString() {
private boolean endOfArguments = false;
private int characterIndex = 0;

private static final Pattern VERSION_FLAG = Pattern.compile("^--[12]\\.[89012]$");

public ArgumentProcessor(String[] arguments, RubyInstanceConfig config) {
this(arguments, true, false, false, config);
}
@@ -482,18 +485,9 @@ private void processArgument() {
}

break FOR;
} else if (argument.equals("--1.8")) {
config.getError().println("warning: " + argument + " ignored");
break FOR;
} else if (argument.equals("--1.9")) {
} else if (VERSION_FLAG.matcher(argument).matches()) {
config.getError().println("warning: " + argument + " ignored");
break FOR;
} else if (argument.equals("--2.0")) {
config.getError().println("warning: " + argument + " ignored");
break FOR;
} else if (argument.equals("--2.1")) {
// keep the switch for consistency
break FOR;
} else if (argument.equals("--disable-gems")) {
config.setDisableGems(true);
break FOR;
8 changes: 8 additions & 0 deletions spec/ruby/core/module/fixtures/classes.rb
Original file line number Diff line number Diff line change
@@ -504,6 +504,14 @@ def self.get_constant_from_scope_with_send(method)
send(method, "Lookup")
end
end

class SuperInClassMethodWithPrepend
def self.inherited(base)
super
end
end

SuperInClassMethodWithPrepend.singleton_class.prepend(Module.new)
end

class Object
6 changes: 6 additions & 0 deletions spec/ruby/core/module/prepend_spec.rb
Original file line number Diff line number Diff line change
@@ -287,4 +287,10 @@ class ModuleSpecs::PrependSuperInSingletonClass
end
end.should_not raise_error
end

it "supports super when the module is prepended into a singleton class with a class super" do
lambda do
Class.new(ModuleSpecs::SuperInClassMethodWithPrepend)
end.should_not raise_error
end
end