public static void load(Ruby runtime) { define(runtime.getOrCreateModule("Timeout")); }
public static void load(Ruby runtime) { define(runtime.getOrCreateModule("Timeout")); }
@Deprecated public static RubyClass getClass(Ruby runtime, String name, RubyClass parent, ObjectAllocator allocator, Class annoClass) { RubyModule jruby = runtime.getOrCreateModule("JRuby"); RubyClass klass = jruby.getClass(name); if (klass == null) { klass = jruby.defineClassUnder(name, parent, allocator); klass.defineAnnotatedMethods(annoClass); } return klass; }
public void load(Ruby runtime, boolean wrap) { RubyModule jrubyModule = runtime.getOrCreateModule("JRuby"); RubyModule config = jrubyModule.defineModuleUnder("CONFIG"); config.getSingletonClass().defineAnnotatedMethods(JRubyConfigLibrary.class); }
public void load(Ruby runtime, boolean wrap) { RubyModule jrubyModule = runtime.getOrCreateModule("JRuby"); RubyModule config = jrubyModule.defineModuleUnder("CONFIG"); config.getSingletonClass().defineAnnotatedMethods(JRubyConfigLibrary.class); }
private static RubyClass getRackInputClass(Ruby runtime) { RubyModule module = runtime.getOrCreateModule("RackServlet"); RubyClass klass = module.getClass("RackInput"); if (klass == null) { klass = module.defineClassUnder("RackInput", runtime.getObject(), ALLOCATOR); klass.defineAnnotatedMethods(JRubyRackInput.class); } return klass; }
public void load(Ruby runtime, boolean wrap) throws IOException { RubyModule mJRubyUtil = runtime.getOrCreateModule("JRuby").defineModuleUnder("Util"); mJRubyUtil.defineAnnotatedMethods(JRubyUtilLibrary.class); // core class utils runtime.getString().defineAnnotatedMethods(StringUtils.class); }
public void load(Ruby runtime, boolean wrap) throws IOException { RubyModule mJRubyUtil = runtime.getOrCreateModule("JRuby").defineModuleUnder("Util"); mJRubyUtil.defineAnnotatedMethods(JRubyUtilLibrary.class); // core class utils runtime.getString().defineAnnotatedMethods(StringUtils.class); }
private static RubyClass getRackInputClass(Ruby runtime) { RubyModule module = runtime.getOrCreateModule("RackServlet"); RubyClass klass = module.getClass("RackInput"); if (klass == null) { klass = module.defineClassUnder("RackInput", runtime.getObject(), ALLOCATOR); klass.defineAnnotatedMethods(JRubyRackInput.class); } return klass; }
public void load(Ruby runtime, boolean wrap) throws IOException { RubyModule JRuby = runtime.getOrCreateModule("JRuby"); RubyModule JRubyUtil = JRuby.defineModuleUnder("Util"); JRubyUtil.defineAnnotatedMethods(JRubyUtilLibrary.class); JRubyUtil.setConstant("SEPARATOR", runtime.newString(org.jruby.util.cli.ArgumentProcessor.SEPARATOR)); JRubyUtil.setConstant("ON_WINDOWS", runtime.newBoolean(org.jruby.platform.Platform.IS_WINDOWS)); JRubyUtil.setConstant("ON_SOLARIS", runtime.newBoolean(org.jruby.platform.Platform.IS_SOLARIS)); }
public void load(Ruby runtime, boolean wrap) throws IOException { RubyModule JRuby = runtime.getOrCreateModule("JRuby"); RubyModule JRubyUtil = JRuby.defineModuleUnder("Util"); JRubyUtil.defineAnnotatedMethods(JRubyUtilLibrary.class); JRubyUtil.setConstant("SEPARATOR", runtime.newString(org.jruby.util.cli.ArgumentProcessor.SEPARATOR)); JRubyUtil.setConstant("ON_WINDOWS", runtime.newBoolean(org.jruby.platform.Platform.IS_WINDOWS)); JRubyUtil.setConstant("ON_SOLARIS", runtime.newBoolean(org.jruby.platform.Platform.IS_SOLARIS)); }
public static RubyClass getRackInputClass(final Ruby runtime) { // JRuby::Rack::Input RubyModule jruby = runtime.getOrCreateModule("JRuby"); RubyModule rack = (RubyModule) jruby.getConstantAt("Rack"); if (rack == null) { rack = runtime.defineModuleUnder("Rack", jruby); } RubyClass klass = rack.getClass("Input"); // JRuby::Rack getClass('Input') if (klass == null) { final RubyClass parent = runtime.getObject(); klass = rack.defineClassUnder("Input", parent, ALLOCATOR); klass.defineAnnotatedMethods(RackInput.class); } if (jruby.getConstantAt("RackInput") == null) { // backwards compatibility jruby.setConstant("RackInput", klass); // JRuby::RackInput #deprecated } return klass; }
public void load(Ruby runtime, boolean wrap) { runtime.getLoadService().require("java"); // load Ruby parts of the 'jruby' library runtime.getLoadService().loadFromClassLoader(runtime.getJRubyClassLoader(), "jruby/jruby.rb", false); RubyModule JRuby = runtime.getOrCreateModule("JRuby"); JRuby.defineAnnotatedMethods(JRubyLibrary.class); JRuby.defineAnnotatedMethods(JRubyUtilLibrary.class); JRuby.defineClassUnder("ThreadLocal", runtime.getObject(), JRubyThreadLocal.ALLOCATOR) .defineAnnotatedMethods(JRubyExecutionContextLocal.class); JRuby.defineClassUnder("FiberLocal", runtime.getObject(), JRubyFiberLocal.ALLOCATOR) .defineAnnotatedMethods(JRubyExecutionContextLocal.class); RubyModule CONFIG = JRuby.defineModuleUnder("CONFIG"); CONFIG.getSingletonClass().defineAnnotatedMethods(JRubyConfig.class); }
public void load(Ruby runtime, boolean wrap) { runtime.getLoadService().require("java"); // load Ruby parts of the 'jruby' library runtime.getLoadService().loadFromClassLoader(runtime.getJRubyClassLoader(), "jruby/jruby.rb", false); RubyModule JRuby = runtime.getOrCreateModule("JRuby"); JRuby.defineAnnotatedMethods(JRubyLibrary.class); JRuby.defineAnnotatedMethods(JRubyUtilLibrary.class); JRuby.defineClassUnder("ThreadLocal", runtime.getObject(), JRubyThreadLocal.ALLOCATOR) .defineAnnotatedMethods(JRubyExecutionContextLocal.class); JRuby.defineClassUnder("FiberLocal", runtime.getObject(), JRubyFiberLocal.ALLOCATOR) .defineAnnotatedMethods(JRubyExecutionContextLocal.class); RubyModule CONFIG = JRuby.defineModuleUnder("CONFIG"); CONFIG.getSingletonClass().defineAnnotatedMethods(JRubyConfig.class); }
public void load(Ruby runtime, boolean wrap) { ThreadContext context = runtime.getCurrentContext(); runtime.getLoadService().require("java"); // load Ruby parts of the 'jruby' library runtime.getLoadService().loadFromClassLoader(runtime.getJRubyClassLoader(), "jruby/jruby.rb", false); // define JRuby module RubyModule jrubyModule = runtime.getOrCreateModule("JRuby"); jrubyModule.defineAnnotatedMethods(JRubyLibrary.class); jrubyModule.defineAnnotatedMethods(JRubyUtilLibrary.class); RubyClass threadLocalClass = jrubyModule.defineClassUnder("ThreadLocal", runtime.getObject(), JRubyThreadLocal.ALLOCATOR); threadLocalClass.defineAnnotatedMethods(JRubyExecutionContextLocal.class); RubyClass fiberLocalClass = jrubyModule.defineClassUnder("FiberLocal", runtime.getObject(), JRubyFiberLocal.ALLOCATOR); fiberLocalClass.defineAnnotatedMethods(JRubyExecutionContextLocal.class); new JRubyConfigLibrary().load(runtime, wrap); }
public void load(Ruby runtime, boolean wrap) { ThreadContext context = runtime.getCurrentContext(); runtime.getLoadService().require("java"); // load Ruby parts of the 'jruby' library runtime.getLoadService().loadFromClassLoader(runtime.getJRubyClassLoader(), "jruby/jruby.rb", false); // define JRuby module RubyModule jrubyModule = runtime.getOrCreateModule("JRuby"); jrubyModule.defineAnnotatedMethods(JRubyLibrary.class); jrubyModule.defineAnnotatedMethods(JRubyUtilLibrary.class); RubyClass threadLocalClass = jrubyModule.defineClassUnder("ThreadLocal", runtime.getObject(), JRubyThreadLocal.ALLOCATOR); threadLocalClass.defineAnnotatedMethods(JRubyExecutionContextLocal.class); RubyClass fiberLocalClass = jrubyModule.defineClassUnder("FiberLocal", runtime.getObject(), JRubyFiberLocal.ALLOCATOR); fiberLocalClass.defineAnnotatedMethods(JRubyExecutionContextLocal.class); new JRubyConfigLibrary().load(runtime, wrap); }
public boolean basicLoad(final Ruby runtime) throws IOException { ThreadContext ctx = runtime.getCurrentContext(); RubyModule rb_yaml = runtime.getOrCreateModule("YAML"); RubyModule rb_yecht = rb_yaml.defineModuleUnder("Yecht"); rb_yecht.defineConstant("VERSION", runtime.newString(YAML.YECHT_VERSION));