Skip to content

Commit

Permalink
Showing 2 changed files with 2 additions and 21 deletions.
8 changes: 0 additions & 8 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -111,8 +111,6 @@ public class RubyContext extends ExecutionContext {
private final SourceCache sourceCache;
private final CallGraph callGraph;

private final boolean runningOnWindows;

private final PrintStream debugStandardOut;

private final Map<String, TruffleObject> exported = new HashMap<>();
@@ -197,8 +195,6 @@ public RubyContext(Ruby runtime, TruffleLanguage.Env env) {
instrumentationServerManager = null;
}

runningOnWindows = Platform.getPlatform().getOS() == OS_TYPE.WINDOWS;

attachmentsManager = new AttachmentsManager(this);
sourceCache = new SourceCache(new SourceLoader(this));

@@ -350,10 +346,6 @@ public static String checkClassVariableName(RubyContext context, String name, No
return name;
}

public boolean isRunningOnWindows() {
return runningOnWindows;
}

public void loadFile(String fileName, Node currentNode) throws IOException {
loadFileAbsolute(fileName, currentNode);
}
Original file line number Diff line number Diff line change
@@ -183,19 +183,8 @@ public boolean isAbsolutePath(String path) {
}

public static String expandPath(RubyContext context, String fileName) {
// TODO (nirvdrum 11-Feb-15) This needs to work on Windows without calling into non-Truffle JRuby.
if (context.isRunningOnWindows()) {
final org.jruby.RubyString path = context.toJRubyString(StringOperations.createString(context, StringOperations.encodeRope(fileName, UTF8Encoding.INSTANCE)));
final org.jruby.RubyString expanded = (org.jruby.RubyString) org.jruby.RubyFile.expand_path19(
context.getRuntime().getCurrentContext(),
null,
new org.jruby.runtime.builtin.IRubyObject[]{ path });

return expanded.asJavaString();
} else {
String dir = new File(fileName).isAbsolute() ? null : context.getRuntime().getCurrentDirectory();
return expandPath(fileName, dir);
}
String dir = new File(fileName).isAbsolute() ? null : context.getRuntime().getCurrentDirectory();
return expandPath(fileName, dir);
}

private static String expandPath(String fileName, String dir) {

1 comment on commit 1683247

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, something went wrong.

Please sign in to comment.