Package org.jruby.runtime.builtin

Examples of org.jruby.runtime.builtin.IRubyObject.asString()


                tmp = RubyString.objAsString(context, tmp);
            }

            if (i > begin && !sep.isNil()) buf.append(strSep.getByteList());

            buf.append(tmp.asString().getByteList());
            if (tmp.isTaint()) taint = true;
        }

        RubyString result = runtime.newString(buf);
View Full Code Here


                       if (listSize-- <= 0) {
                           throw runtime.newArgumentError(sTooFew);
                       }

                       IRubyObject from = list.eltInternal(idx++);
                       lCurElemString = from == runtime.getNil() ? ByteList.EMPTY_BYTELIST : from.asString().getByteList();

                       if (occurrences <= 1) {
                           occurrences = 72;
                       }
View Full Code Here

                case 'w' :
                    if (listSize-- <= 0) {
                        throw runtime.newArgumentError(sTooFew);
                    }
                    IRubyObject from = list.eltInternal(idx++);
                    String stringVal = from == runtime.getNil() ? "0" : from.asString().toString();
                    BigInteger bigInt = new BigInteger(stringVal);
                   
                    // we don't deal with negatives.
                    if (bigInt.compareTo(BigInteger.ZERO) >= 0) {
                        int bitLength = bigInt.toString(2).length();
View Full Code Here

                    if (arg == null) arg = args.next();

                    if (fchar == 'p') {
                        arg = arg.callMethod(arg.getRuntime().getCurrentContext(),"inspect");
                    }
                    ByteList bytes = arg.asString().getByteList();
                    int len = bytes.length();
                    if (arg.isTaint()) {
                        buf.tainted = true;
                    }
                    if ((flags & FLAG_PRECISION) != 0 && precision < len) {
View Full Code Here

                }
            }

            if (i > 0 && sepBytes != null) buf.append(sepBytes);

            buf.append(tmp.asString().getByteList());
            if (tmp.isTaint()) taint = true;
            if (tmp.isUntrusted()) untrusted = true;
        }

        RubyString result = runtime.newString(buf);
View Full Code Here

                       if (listSize-- <= 0) {
                           throw runtime.newArgumentError(sTooFew);
                       }

                       IRubyObject from = list.eltInternal(idx++);
                       lCurElemString = from == runtime.getNil() ? ByteList.EMPTY_BYTELIST : from.asString().getByteList();

                       if (occurrences <= 1) {
                           occurrences = 72;
                       }
View Full Code Here

                    if (arg == null) arg = args.next();

                    if (fchar == 'p') {
                        arg = arg.callMethod(arg.getRuntime().getCurrentContext(),"inspect");
                    }
                    ByteList bytes = arg.asString().getByteList();
                    int len = bytes.length();
                    if (arg.isTaint()) tainted = true;
                    if ((flags & FLAG_PRECISION) != 0 && precision < len) {
                        len = precision;
                    }
View Full Code Here

                    }

                    if (fchar == 'p') {
                        arg = arg.callMethod(arg.getRuntime().getCurrentContext(),"inspect");
                    }
                    RubyString strArg = arg.asString();
                    ByteList bytes = strArg.getByteList();
                    Encoding enc = wrapper.checkEncoding(strArg);
                    int len = bytes.length();
                    int strLen = strArg.strLength();
View Full Code Here

                    break;
                case 'M' : {
                       if (listSize-- <= 0) throw runtime.newArgumentError(sTooFew);

                       IRubyObject from = list.eltInternal(idx++);
                       lCurElemString = from == runtime.getNil() ? ByteList.EMPTY_BYTELIST : from.asString().getByteList();

                       if (occurrences <= 1) {
                           occurrences = 72;
                       }
View Full Code Here

                }
            }

            if (i > 0 && sepBytes != null) buf.append(sepBytes);

            buf.append(tmp.asString().getByteList());
            if (tmp.isTaint()) taint = true;
            if (tmp.isUntrusted()) untrusted = true;
        }

        RubyString result = runtime.newString(buf);
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.