public static void createProtobuf(Ruby runtime) { RubyModule mGoogle = runtime.getModule("Google"); RubyModule mProtobuf = mGoogle.defineModuleUnder("Protobuf"); mProtobuf.defineAnnotatedMethods(RubyProtobuf.class); }
public static void createRubyOneofBuilderContext(Ruby runtime) { RubyModule protobuf = runtime.getClassFromPath("Google::Protobuf"); RubyModule internal = protobuf.defineModuleUnder("Internal"); RubyClass cRubyOneofBuidlerContext = internal.defineClassUnder("OneofBuilderContext", runtime.getObject(), new ObjectAllocator() { @Override public IRubyObject allocate(Ruby ruby, RubyClass rubyClass) { return new RubyOneofBuilderContext(ruby, rubyClass); } }); cRubyOneofBuidlerContext.defineAnnotatedMethods(RubyOneofBuilderContext.class); }
public static void createIOModule(Ruby runtime, RubyModule ffi) { RubyModule module = ffi.defineModuleUnder("IO"); module.defineAnnotatedMethods(IOModule.class); }
public static void createIOModule(Ruby runtime, RubyModule ffi) { RubyModule module = ffi.defineModuleUnder("IO"); module.defineAnnotatedMethods(IOModule.class); }
public static void createIOModule(Ruby runtime, RubyModule ffi) { RubyModule module = ffi.defineModuleUnder("IO"); module.defineAnnotatedMethods(IOModule.class); }
public static void createIOModule(Ruby runtime, RubyModule ffi) { RubyModule module = ffi.defineModuleUnder("IO"); module.defineAnnotatedMethods(IOModule.class); }
public static RubyModule createDataConverterModule(Ruby runtime, RubyModule module) { RubyModule result = module.defineModuleUnder("DataConverter"); result.defineAnnotatedMethods(DataConverter.class); result.defineAnnotatedConstants(DataConverter.class); return result; }
public static RubyModule createDataConverterModule(Ruby runtime, RubyModule module) { RubyModule result = module.defineModuleUnder("DataConverter"); result.defineAnnotatedMethods(DataConverter.class); result.defineAnnotatedConstants(DataConverter.class); return result; }
/** * * @param runtime Ruby */ public static void createArcBall(final Ruby runtime) { RubyModule processing = runtime.defineModule("Processing"); RubyModule arcBallModule = processing.defineModuleUnder("ArcBall"); arcBallModule.defineAnnotatedMethods(Rarcball.class); }
public static RubyModule createDataConverterModule(Ruby runtime, RubyModule module) { RubyModule result = module.defineModuleUnder("DataConverter"); result.defineAnnotatedMethods(DataConverter.class); result.defineAnnotatedConstants(DataConverter.class); return result; }
public static RubyModule createDataConverterModule(Ruby runtime, RubyModule module) { RubyModule result = module.defineModuleUnder("DataConverter"); result.defineAnnotatedMethods(DataConverter.class); result.defineAnnotatedConstants(DataConverter.class); return result; }
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); }
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); }
public static void createDigest(Ruby runtime) { try { provider = (Provider) Class.forName(PROVIDER).newInstance(); } catch (Throwable t) { /* provider is not available */ } RubyModule mDigest = runtime.defineModule("Digest"); mDigest.defineAnnotatedMethods(RubyDigest.class); RubyModule mDigestInstance = mDigest.defineModuleUnder("Instance"); mDigestInstance.defineAnnotatedMethods(DigestInstance.class); RubyClass cDigestClass = mDigest.defineClassUnder("Class", runtime.getObject(), DigestClass.DIGEST_CLASS_ALLOCATOR); cDigestClass.defineAnnotatedMethods(DigestClass.class); cDigestClass.includeModule(mDigestInstance); RubyClass cDigestBase = mDigest.defineClassUnder("Base", cDigestClass, DigestBase.DIGEST_BASE_ALLOCATOR); cDigestBase.defineAnnotatedMethods(DigestBase.class); }
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 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); }