Skip to content

Instantly share code, notes, and snippets.

@bjfish
Created April 30, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjfish/21ea81eee6d4aa24fa95 to your computer and use it in GitHub Desktop.
Save bjfish/21ea81eee6d4aa24fa95 to your computer and use it in GitHub Desktop.
@CoreMethod(names = "home_directory", onSingleton = true)
public abstract static class HomeDirectoryNode extends CoreMethodNode {
public HomeDirectoryNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}
public HomeDirectoryNode(HomeDirectoryNode prev) {
super(prev);
}
@CompilerDirectives.TruffleBoundary
@Specialization
public RubyString homeDirectory() {
return getContext().makeString(getContext().getRuntime().getJRubyHome());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment