Java Code Examples for org.jruby.Ruby#defineGlobalConstant()

The following examples show how to use org.jruby.Ruby#defineGlobalConstant() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandBlockRunner.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * setErrorWriter
 * 
 * @param io
 */
protected void setErrorWriter(IRubyObject io)
{
	Ruby runtime = getRuntime();

	runtime.defineVariable(new OutputGlobalVariable(runtime, STDERR_GLOBAL, io));
	runtime.defineGlobalConstant(STDERR_CONSTANT, io);
	runtime.getGlobalVariables().alias(DEFERR_GLOBAL, STDERR_GLOBAL);
}
 
Example 2
Source File: CommandBlockRunner.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * setReader
 * 
 * @param io
 */
protected void setReader(IRubyObject io)
{
	Ruby runtime = this.getRuntime();

	runtime.defineVariable(new InputGlobalVariable(runtime, STDIN_GLOBAL, io));
	runtime.defineGlobalConstant(STDIN_CONSTANT, io);
}
 
Example 3
Source File: CommandBlockRunner.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * setWriter
 * 
 * @param io
 */
protected void setWriter(IRubyObject io)
{
	Ruby runtime = this.getRuntime();

	runtime.defineVariable(new OutputGlobalVariable(runtime, STDOUT_GLOBAL, io));
	runtime.defineGlobalConstant(STDOUT_CONSTANT, io);
	runtime.getGlobalVariables().alias(STDOUT_GLOBAL2, STDOUT_GLOBAL);
	runtime.getGlobalVariables().alias(DEFOUT_GLOBAL, STDOUT_GLOBAL);
}