Examples of newString()


Examples of org.jruby.Ruby.newString()

                if(sock_dgram) {
                    c = new IRubyObject[7];
                    c[0] = r.newString("AF_INET");
                    c[1] = port;
                    c[2] = r.newString(addrs[i].getCanonicalHostName());
                    c[3] = r.newString(addrs[i].getHostAddress());
                    c[4] = r.newFixnum(PF_INET);
                    c[5] = r.newFixnum(SOCK_DGRAM);
                    c[6] = r.newFixnum(IPPROTO_UDP);
                    l.add(r.newArrayNoCopy(c));
                }
View Full Code Here

Examples of org.jruby.Ruby.newString()

                    c[6] = r.newFixnum(IPPROTO_UDP);
                    l.add(r.newArrayNoCopy(c));
                }
                if(sock_stream) {
                    c = new IRubyObject[7];
                    c[0] = r.newString("AF_INET");
                    c[1] = port;
                    c[2] = r.newString(addrs[i].getCanonicalHostName());
                    c[3] = r.newString(addrs[i].getHostAddress());
                    c[4] = r.newFixnum(PF_INET);
                    c[5] = r.newFixnum(SOCK_STREAM);
View Full Code Here

Examples of org.jruby.Ruby.newString()

                }
                if(sock_stream) {
                    c = new IRubyObject[7];
                    c[0] = r.newString("AF_INET");
                    c[1] = port;
                    c[2] = r.newString(addrs[i].getCanonicalHostName());
                    c[3] = r.newString(addrs[i].getHostAddress());
                    c[4] = r.newFixnum(PF_INET);
                    c[5] = r.newFixnum(SOCK_STREAM);
                    c[6] = r.newFixnum(IPPROTO_TCP);
                    l.add(r.newArrayNoCopy(c));
View Full Code Here

Examples of org.jruby.Ruby.newString()

                if(sock_stream) {
                    c = new IRubyObject[7];
                    c[0] = r.newString("AF_INET");
                    c[1] = port;
                    c[2] = r.newString(addrs[i].getCanonicalHostName());
                    c[3] = r.newString(addrs[i].getHostAddress());
                    c[4] = r.newFixnum(PF_INET);
                    c[5] = r.newFixnum(SOCK_STREAM);
                    c[6] = r.newFixnum(IPPROTO_TCP);
                    l.add(r.newArrayNoCopy(c));
                }
View Full Code Here

Examples of org.jruby.Ruby.newString()

                }
            } catch(Exception e) {
                // No constant available, so we'll fall back on YAML::Object
                objClass = (RubyClass)runtime.fastGetModule("YAML").fastGetConstant("Object");
                final RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
                return RuntimeHelpers.invoke(runtime.getCurrentContext(), objClass, "new", runtime.newString(tag), vars);
            }
        }
        final RubyClass theCls = (RubyClass)objClass;
        final RubyObject oo = (RubyObject)theCls.getAllocator().allocate(runtime, theCls);
        final Map vars = (Map)(ctor.constructMapping(node));
View Full Code Here

Examples of org.jruby.Ruby.newString()

        }

        // If no such struct exists...
        if(sClass == null) {
            IRubyObject[] params = new IRubyObject[val.size()+1];
            params[0] = runtime.newString(tag);
            int i = 1;
            for(Iterator iter = val.entrySet().iterator();iter.hasNext();i++) {
                Map.Entry em = (Map.Entry)iter.next();
                params[i] = ((RubyString)em.getKey()).intern();
            }
View Full Code Here

Examples of org.jruby.Ruby.newString()

    public static Object constructRuby(final Constructor ctor, final RubyClass theCls, final Node node) {
        final Ruby runtime = ((JRubyConstructor)ctor).runtime;
        if(theCls.respondsTo("yaml_new")) {
            final RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
            return RuntimeHelpers.invoke(runtime.getCurrentContext(), theCls, "yaml_new", theCls, runtime.newString(node.getTag()), vars);
        } else {
            final RubyObject oo = (RubyObject)theCls.getAllocator().allocate(runtime, theCls);
            if (oo.respondsTo("yaml_initialize")) {
                RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
                RuntimeHelpers.invoke(runtime.getCurrentContext(), oo, "yaml_initialize", runtime.newString(node.getTag()), vars);
View Full Code Here

Examples of org.jruby.Ruby.newString()

            return RuntimeHelpers.invoke(runtime.getCurrentContext(), theCls, "yaml_new", theCls, runtime.newString(node.getTag()), vars);
        } else {
            final RubyObject oo = (RubyObject)theCls.getAllocator().allocate(runtime, theCls);
            if (oo.respondsTo("yaml_initialize")) {
                RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
                RuntimeHelpers.invoke(runtime.getCurrentContext(), oo, "yaml_initialize", runtime.newString(node.getTag()), vars);
            } else {
                final Map vars = (Map)(ctor.constructMapping(node));
                ctor.doRecursionFix(node, oo);
                for(final Iterator iter = vars.keySet().iterator();iter.hasNext();) {
                    final IRubyObject key = (IRubyObject)iter.next();
View Full Code Here

Examples of org.jruby.Ruby.newString()

                }
            } catch(Exception e) {
                // No constant available, so we'll fall back on YAML::Object
                objClass = (RubyClass)runtime.fastGetModule("YAML").fastGetConstant("Object");
                final RubyHash vars = (RubyHash)(((JRubyConstructor)ctor).constructRubyMapping(node));
                return RuntimeHelpers.invoke(runtime.getCurrentContext(), objClass, "new", runtime.newString(tag), vars);
            }
        }
        final RubyClass theCls = (RubyClass)objClass;
        return constructRuby(ctor,theCls,node);
    }
View Full Code Here

Examples of org.jruby.Ruby.newString()

            } else {
                ix = s1.indexOf("..");
                first = s1.substring(0,ix);
                second = s1.substring(ix+2);
            }
            IRubyObject fist = runtime.fastGetModule("YAML").callMethod(context,"load",runtime.newString(first));
            IRubyObject sic = runtime.fastGetModule("YAML").callMethod(context,"load",runtime.newString(second));
            return RubyRange.newRange(runtime, context, fist, sic, exc);
        } else {
            final Map vars = (Map)(ctor.constructMapping(node));
            IRubyObject beg = (IRubyObject)vars.get(runtime.newString("begin"));
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.