Examples of defineConstant()


Examples of org.jruby.RubyModule.defineConstant()

        RubyModule configModule = runtime.defineModule("Config");
       
        configModule.defineAnnotatedMethods(RbConfigLibrary.class);
       
        RubyHash configHash = RubyHash.newHash(runtime);
        configModule.defineConstant("CONFIG", configHash);
        runtime.getObject().defineConstant("RbConfig", configModule);

        String[] versionParts;
        if (runtime.is1_9()) {
            versionParts = Constants.RUBY1_9_VERSION.split("\\.");
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

    public void load(final Ruby runtime, boolean wrap) throws IOException {
        RubyModule mFcntl = runtime.defineModule("Fcntl");

        runtime.loadConstantSet(mFcntl, "Fcntl");
        runtime.loadConstantSet(mFcntl, "OpenFlags");
        mFcntl.defineConstant("FD_CLOEXEC", RubyFixnum.newFixnum(runtime, FD_CLOEXEC));
    }
}
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

        module.defineConstant("IS_MAC", runtime.newBoolean(os == OS.DARWIN));
        module.defineConstant("LIBC", runtime.newString(LIBC));
        module.defineConstant("LIBPREFIX", runtime.newString(LIBPREFIX));
        module.defineConstant("LIBSUFFIX", runtime.newString(LIBSUFFIX));
        module.defineConstant("BYTE_ORDER", runtime.newFixnum(BYTE_ORDER));
        module.defineConstant("BIG_ENDIAN", runtime.newFixnum(BIG_ENDIAN));
        module.defineConstant("LITTLE_ENDIAN", runtime.newFixnum(LITTLE_ENDIAN));
        module.defineAnnotatedMethods(Platform.class);
    }
    @JRubyMethod(name = "windows?", module=true)
    public static IRubyObject windows_p(ThreadContext context, IRubyObject recv) {
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

        module.defineConstant("LIBC", runtime.newString(LIBC));
        module.defineConstant("LIBPREFIX", runtime.newString(LIBPREFIX));
        module.defineConstant("LIBSUFFIX", runtime.newString(LIBSUFFIX));
        module.defineConstant("BYTE_ORDER", runtime.newFixnum(BYTE_ORDER));
        module.defineConstant("BIG_ENDIAN", runtime.newFixnum(BIG_ENDIAN));
        module.defineConstant("LITTLE_ENDIAN", runtime.newFixnum(LITTLE_ENDIAN));
        module.defineAnnotatedMethods(Platform.class);
    }
    @JRubyMethod(name = "windows?", module=true)
    public static IRubyObject windows_p(ThreadContext context, IRubyObject recv) {
        return context.getRuntime().newBoolean(OS == OS.WINDOWS);
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

    }
    public static void createPlatformModule(Ruby runtime, RubyModule ffi) {
        RubyModule module = ffi.defineModuleUnder("Platform");
        Platform platform = Platform.getPlatform();
        OS_TYPE os = platform.getOS();
        module.defineConstant("ADDRESS_SIZE", runtime.newFixnum(platform.addressSize));
        module.defineConstant("LONG_SIZE", runtime.newFixnum(platform.longSize));
        module.defineConstant("OS", runtime.newString(OS.toString()));
        module.defineConstant("ARCH", runtime.newString(platform.getCPU().toString()));
        module.defineConstant("NAME", runtime.newString(platform.getName()));
        module.defineConstant("IS_WINDOWS", runtime.newBoolean(os == OS.WINDOWS));
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

    public static void createPlatformModule(Ruby runtime, RubyModule ffi) {
        RubyModule module = ffi.defineModuleUnder("Platform");
        Platform platform = Platform.getPlatform();
        OS_TYPE os = platform.getOS();
        module.defineConstant("ADDRESS_SIZE", runtime.newFixnum(platform.addressSize));
        module.defineConstant("LONG_SIZE", runtime.newFixnum(platform.longSize));
        module.defineConstant("OS", runtime.newString(OS.toString()));
        module.defineConstant("ARCH", runtime.newString(platform.getCPU().toString()));
        module.defineConstant("NAME", runtime.newString(platform.getName()));
        module.defineConstant("IS_WINDOWS", runtime.newBoolean(os == OS.WINDOWS));
        module.defineConstant("IS_BSD", runtime.newBoolean(platform.isBSD()));
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

        RubyModule module = ffi.defineModuleUnder("Platform");
        Platform platform = Platform.getPlatform();
        OS_TYPE os = platform.getOS();
        module.defineConstant("ADDRESS_SIZE", runtime.newFixnum(platform.addressSize));
        module.defineConstant("LONG_SIZE", runtime.newFixnum(platform.longSize));
        module.defineConstant("OS", runtime.newString(OS.toString()));
        module.defineConstant("ARCH", runtime.newString(platform.getCPU().toString()));
        module.defineConstant("NAME", runtime.newString(platform.getName()));
        module.defineConstant("IS_WINDOWS", runtime.newBoolean(os == OS.WINDOWS));
        module.defineConstant("IS_BSD", runtime.newBoolean(platform.isBSD()));
        module.defineConstant("IS_FREEBSD", runtime.newBoolean(os == OS.FREEBSD));
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

        Platform platform = Platform.getPlatform();
        OS_TYPE os = platform.getOS();
        module.defineConstant("ADDRESS_SIZE", runtime.newFixnum(platform.addressSize));
        module.defineConstant("LONG_SIZE", runtime.newFixnum(platform.longSize));
        module.defineConstant("OS", runtime.newString(OS.toString()));
        module.defineConstant("ARCH", runtime.newString(platform.getCPU().toString()));
        module.defineConstant("NAME", runtime.newString(platform.getName()));
        module.defineConstant("IS_WINDOWS", runtime.newBoolean(os == OS.WINDOWS));
        module.defineConstant("IS_BSD", runtime.newBoolean(platform.isBSD()));
        module.defineConstant("IS_FREEBSD", runtime.newBoolean(os == OS.FREEBSD));
        module.defineConstant("IS_OPENBSD", runtime.newBoolean(os == OS.OPENBSD));
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

        OS_TYPE os = platform.getOS();
        module.defineConstant("ADDRESS_SIZE", runtime.newFixnum(platform.addressSize));
        module.defineConstant("LONG_SIZE", runtime.newFixnum(platform.longSize));
        module.defineConstant("OS", runtime.newString(OS.toString()));
        module.defineConstant("ARCH", runtime.newString(platform.getCPU().toString()));
        module.defineConstant("NAME", runtime.newString(platform.getName()));
        module.defineConstant("IS_WINDOWS", runtime.newBoolean(os == OS.WINDOWS));
        module.defineConstant("IS_BSD", runtime.newBoolean(platform.isBSD()));
        module.defineConstant("IS_FREEBSD", runtime.newBoolean(os == OS.FREEBSD));
        module.defineConstant("IS_OPENBSD", runtime.newBoolean(os == OS.OPENBSD));
        module.defineConstant("IS_SOLARIS", runtime.newBoolean(os == OS.SOLARIS));
View Full Code Here

Examples of org.jruby.RubyModule.defineConstant()

        module.defineConstant("ADDRESS_SIZE", runtime.newFixnum(platform.addressSize));
        module.defineConstant("LONG_SIZE", runtime.newFixnum(platform.longSize));
        module.defineConstant("OS", runtime.newString(OS.toString()));
        module.defineConstant("ARCH", runtime.newString(platform.getCPU().toString()));
        module.defineConstant("NAME", runtime.newString(platform.getName()));
        module.defineConstant("IS_WINDOWS", runtime.newBoolean(os == OS.WINDOWS));
        module.defineConstant("IS_BSD", runtime.newBoolean(platform.isBSD()));
        module.defineConstant("IS_FREEBSD", runtime.newBoolean(os == OS.FREEBSD));
        module.defineConstant("IS_OPENBSD", runtime.newBoolean(os == OS.OPENBSD));
        module.defineConstant("IS_SOLARIS", runtime.newBoolean(os == OS.SOLARIS));
        module.defineConstant("IS_LINUX", runtime.newBoolean(os == OS.LINUX));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.