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

Commits on Mar 2, 2015

  1. [Truffle] Rename method.

    eregon committed Mar 2, 2015
    Copy the full SHA
    e2532dd View commit details
  2. Copy the full SHA
    01df414 View commit details
Showing with 8 additions and 2 deletions.
  1. +8 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -1617,7 +1617,7 @@ public RequireRelativeNode(RequireRelativeNode prev) {
}

@Specialization
public boolean require(RubyString feature) {
public boolean requireRelative(RubyString feature) {
notDesignedForCompilation();

final FeatureManager featureManager = getContext().getFeatureManager();
@@ -1636,7 +1636,7 @@ public boolean require(RubyString feature) {
throw new RaiseException(getContext().getCoreLibrary().loadError("cannot infer basepath", this));
}

featurePath = new File(new File(sourcePath).getParent(), featureString).toString();
featurePath = dirname(sourcePath) + "/" + featureString;
}

try {
@@ -1647,6 +1647,12 @@ public boolean require(RubyString feature) {

return true;
}

private String dirname(String path) {
int lastSlash = path.lastIndexOf('/');
assert lastSlash > 0;
return path.substring(0, lastSlash);
}
}

@CoreMethod(names = "respond_to?", required = 1, optional = 1)