Examples of newIndexError()


Examples of org.jruby.Ruby.newIndexError()

            try {
                // TODO: MRI behavior is more complicated than that,
                // there is some magic when dealing with negative indexes.
                return runtime.newString((String) holder.history.getHistoryList().get(i));
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("invalid history index: " + i);
            }
        }

        @JRubyMethod(name = "[]=")
        public static IRubyObject s_hist_set(IRubyObject recv, IRubyObject index, IRubyObject val) {
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            try {
                ThreadContext context = runtime.getCurrentContext();

                return runtime.newString((String) holder.history.getHistoryList().get(i)).taint(context);
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("invalid history index: " + i);
            }
        }

        @JRubyMethod(name = "[]=")
        public static IRubyObject s_hist_set(IRubyObject recv, IRubyObject index, IRubyObject val) {
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            if (i < 0) i += holder.history.size();

            try {
                holder.history.set(i, val.asJavaString());
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("invalid history index: " + i);
        }
            return runtime.getNil();
        }

        @JRubyMethod(name = "shift")
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            ByteBuffer buffer = ((AbstractMemory) dst).getMemoryIO().asByteBuffer();
            int count = RubyNumeric.num2int(rbLength);

            if (count > buffer.remaining()) {
                throw runtime.newIndexError("read count too big for output buffer");
            }

            if (count < buffer.remaining()) {
                buffer = buffer.duplicate();
                buffer.limit(count);
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            if (holder.history.size() == 0) return runtime.getNil();

            try {
                return runtime.newString(holder.history.remove(0)).taint(runtime.getCurrentContext());
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("history shift error");
            }
        }

        @JRubyMethod(name = {"length", "size"})
        public static IRubyObject s_hist_length(IRubyObject recv) {
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            if (i < 0) i += holder.history.size();
           
            try {
                return runtime.newString(holder.history.remove(i)).taint(context);
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("invalid history index: " + i);
            }
        }

        @JRubyMethod(name = "each")
        public static IRubyObject s_hist_each(IRubyObject recv, Block block) {
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            ByteBuffer buffer = ((AbstractMemory) dst).getMemoryIO().asByteBuffer();
            int count = RubyNumeric.num2int(rbLength);

            if (count > buffer.remaining()) {
                throw runtime.newIndexError("read count too big for output buffer");
            }

            if (count < buffer.remaining()) {
                buffer = buffer.duplicate();
                buffer.limit(count);
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            try {
                ThreadContext context = runtime.getCurrentContext();

                return runtime.newString((String) holder.history.get(i)).taint(context);
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("invalid history index: " + i);
            }
        }

        @JRubyMethod(name = "[]=")
        public static IRubyObject s_hist_set(IRubyObject recv, IRubyObject index, IRubyObject val) {
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            if (i < 0) i += holder.history.size();

            try {
                holder.history.set(i, val.asJavaString());
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("invalid history index: " + i);
            }

            return runtime.getNil();
        }
View Full Code Here

Examples of org.jruby.Ruby.newIndexError()

            if (holder.history.isEmpty()) return runtime.getNil();

            try {
                return runtime.newString(holder.history.removeFirst().toString()).taint(runtime.getCurrentContext());
            } catch (IndexOutOfBoundsException ioobe) {
                throw runtime.newIndexError("history shift error");
            }
        }

        @JRubyMethod(name = {"length", "size"})
        public static IRubyObject s_hist_length(IRubyObject recv) {
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.