forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start restructuring API into JRuby and MRI versions
- Loading branch information
Showing
5 changed files
with
88 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.jruby.api; | ||
|
||
import org.jruby.runtime.ThreadContext; | ||
import org.jruby.runtime.builtin.IRubyObject; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class MRI { | ||
public static IRubyObject rb_sys_fail_path(ThreadContext context, String path) { | ||
return API.sysFailWithPath(context, path); | ||
} | ||
|
||
public static int rb_pipe(ThreadContext context, int[] pipes) { | ||
return API.newPipe(context, pipes); | ||
} | ||
|
||
public static int rb_cloexec_pipe(ThreadContext context, int[] pipes) { | ||
return API.cloexecPipe(context, pipes); | ||
} | ||
|
||
public static void rb_maygvl_fd_fix_cloexec(ThreadContext context, int fd) { | ||
API.fdFixCloexec(context, fd); | ||
} | ||
|
||
public static <T> T rb_rescue_typeerror(ThreadContext context, T dflt, Supplier<T> func) { | ||
return API.rescueTypeError(context, dflt, func); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters