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

Commits on Apr 8, 2015

  1. Copy the full SHA
    07f12b9 View commit details
  2. make ObjectSpacer public

    with this you can have a custom implementation of ObjectSpacer and plug it into the runtime
    via reflection.
    mkristian committed Apr 8, 2015
    Copy the full SHA
    a41293b View commit details
  3. permit to set -C uri:classloader:/ via commandline

    to set the current directory uri:classloader:/ is already possible.
    mkristian committed Apr 8, 2015
    Copy the full SHA
    175c8c9 View commit details
  4. Copy the full SHA
    c39a170 View commit details
Showing with 10 additions and 6 deletions.
  1. +1 −1 core/src/main/java/org/jruby/Main.java
  2. +1 −1 core/src/main/java/org/jruby/Ruby.java
  3. +8 −4 core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -495,7 +495,7 @@ private void doCheckSecurityManager() {
}
}

private static int handleRaiseException(RaiseException rj) {
protected static int handleRaiseException(RaiseException rj) {
RubyException raisedException = rj.getException();
Ruby runtime = raisedException.getRuntime();
if (runtime.getSystemExit().isInstance(raisedException)) {
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -4931,7 +4931,7 @@ public CallbackFactory callbackFactory(Class<?> type) {
private EnumMap<DefinedMessage, RubyString> definedMessages = new EnumMap<DefinedMessage, RubyString>(DefinedMessage.class);
private EnumMap<RubyThread.Status, RubyString> threadStatuses = new EnumMap<RubyThread.Status, RubyString>(RubyThread.Status.class);

private interface ObjectSpacer {
public interface ObjectSpacer {
public void addToObjectSpace(Ruby runtime, boolean useObjectSpace, IRubyObject object);
}

12 changes: 8 additions & 4 deletions core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
@@ -180,12 +180,14 @@ private void processArgument() {
String saved = grabValue(getArgumentError(" -C must be followed by a directory expression"));
File base = new File(config.getCurrentDirectory());
File newDir = new File(saved);
if (newDir.isAbsolute()) {
if (saved.startsWith("uri:classloader:")) {
config.setCurrentDirectory(saved);
} else if (newDir.isAbsolute()) {
config.setCurrentDirectory(newDir.getCanonicalPath());
} else {
config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath());
}
if (!(new File(config.getCurrentDirectory()).isDirectory())) {
if (!(new File(config.getCurrentDirectory()).isDirectory()) && !config.getCurrentDirectory().startsWith("uri:classloader:")) {
MainExitException mee = new MainExitException(1, "jruby: Can't chdir to " + saved + " (fatal)");
throw mee;
}
@@ -310,12 +312,14 @@ private void processArgument() {
if (saved != null) {
File base = new File(config.getCurrentDirectory());
File newDir = new File(saved);
if (newDir.isAbsolute()) {
if (saved.startsWith("uri:classloader:")) {
config.setCurrentDirectory(saved);
} else if (newDir.isAbsolute()) {
config.setCurrentDirectory(newDir.getCanonicalPath());
} else {
config.setCurrentDirectory(new File(base, newDir.getPath()).getCanonicalPath());
}
if (!(new File(config.getCurrentDirectory()).isDirectory())) {
if (!(new File(config.getCurrentDirectory()).isDirectory()) && !config.getCurrentDirectory().startsWith("uri:classloader:")) {
MainExitException mee = new MainExitException(1, "jruby: Can't chdir to " + saved + " (fatal)");
throw mee;
}