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

Commits on Dec 14, 2017

  1. Copy the full SHA
    a115d59 View commit details
  2. Copy the full SHA
    f7f31b4 View commit details
Showing with 4 additions and 13 deletions.
  1. +1 −1 core/src/main/java/org/jruby/RubyNumeric.java
  2. +3 −12 core/src/main/java/org/jruby/runtime/load/CompiledScriptLoader.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -649,7 +649,7 @@ public RubyNumeric asNumeric() {
*/
@JRubyMethod(name = "singleton_method_added")
public static IRubyObject sadded(IRubyObject self, IRubyObject name) {
throw self.getRuntime().newTypeError("can't define singleton method " + name + " for " + self.getType().getName());
throw self.getRuntime().newTypeError("can't define singleton method \"" + name + "\" for " + self.getType().getName());
}

/** num_init_copy
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
import org.jruby.util.OneShotClassLoader;
import org.objectweb.asm.ClassReader;

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -73,16 +72,8 @@ private static Class loadCompiledScriptFromClass(Ruby runtime, InputStream in) t
}

public static String getFilenameFromPathAndName(File resourcePath, String resourceName, boolean isAbsolute) {
String name = normalizeSeps(resourceName);
File path = resourcePath;

if(path != null && !isAbsolute) {
// Note: We use RubyFile's canonicalize rather than Java's,
// because Java's will follow symlinks and result in __FILE__
// being set to the target of the symlink rather than the
// filename provided.
name = normalizeSeps(canonicalize(path.getPath()));
}
return name;
// Note: We use RubyFile's canonicalize rather than Java's for relative paths because Java's will follow
// symlinks and result in __FILE__ being set to the target of the symlink rather than the filename provided.
return normalizeSeps(resourcePath != null && !isAbsolute ? canonicalize(resourcePath.getPath()) : resourceName);
}
}