Examples of convertToString()


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

            group = RubyNumeric.num2int(args[1]);
        }
        for (int i = 2; i < args.length; i++) {
            IRubyObject filename = args[i];

            RubyString fileString = filename.convertToString();
            if (!RubyFileTest.exist_p(filename, fileString).isTrue()) {
                throw runtime.newErrnoENOENTError("No such file or directory - " + filename);
            }
           
            boolean result = 0 == runtime.getPosix().chown(fileString.getUnicodeValue(), owner, group);
View Full Code Here

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

        int count = 0;
        RubyInteger mode = args[0].convertToInteger();
        for (int i = 1; i < args.length; i++) {
            IRubyObject filename = args[i];
           
            if (!RubyFileTest.exist_p(filename, filename.convertToString()).isTrue()) {
                throw runtime.newErrnoENOENTError("No such file or directory - " + filename);
            }
           
            boolean result = 0 == runtime.getPosix().lchmod(filename.toString(), (int)mode.getLongValue());
            if (result) {
View Full Code Here

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

        int count = 0;
       
        for (int i = 2; i < args.length; i++) {
            IRubyObject filename = args[i];
           
            if (!RubyFileTest.exist_p(filename, filename.convertToString()).isTrue()) {
                throw runtime.newErrnoENOENTError("No such file or directory - " + filename);
            }
           
            boolean result = 0 == runtime.getPosix().lchown(filename.toString(), owner, group);
            if (result) {
View Full Code Here

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

            sepVal = args[idx];
        } else {
            sepVal = runtime.getRecordSeparatorVar().get();
        }

        ByteList separator = sepVal.isNil() ? null : sepVal.convertToString().getByteList();

        if (separator != null && separator.realSize == 0) {
            separator = Stream.PARAGRAPH_DELIMETER;
        }
View Full Code Here

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

     * Queries <code>JSON.create_id</code>. Returns <code>null</code> if it is
     * set to <code>nil</code> or <code>false</code>, and a String if not.
     */
    private RubyString getCreateId(ThreadContext context) {
        IRubyObject v = info.jsonModule.get().callMethod(context, "create_id");
        return v.isTrue() ? v.convertToString() : null;
    }

    /**
     * A string parsing session.
     *
 
View Full Code Here

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

    RubyString getString(String key, RubyString defaultValue) {
        IRubyObject value = get(key);
        if (value == null || !value.isTrue()) return defaultValue;

        RubyString str = value.convertToString();
        RuntimeInfo info = getRuntimeInfo();
        if (info.encodingsSupported() && str.encoding(context) != info.utf8.get()) {
            str = (RubyString)str.encode(context, info.utf8.get());
        }
        return str;
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.