Package org.jruby

Examples of org.jruby.Ruby.newIOErrorFromException()


        try {
            channel.close();

        } catch (IOException ioe) {
            throw runtime.newIOErrorFromException(ioe);
        }

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


            try {
                holder.readline.getTerminal().setEchoEnabled(false);
                v = holder.readline.readLine(prompt.toString());
                break;
            } catch (IOException ioe) {
                throw runtime.newIOErrorFromException(ioe);
            } finally {
                holder.readline.getTerminal().setEchoEnabled(true);
            }
        }
       
View Full Code Here

        Ruby runtime = context.runtime;
        ConsoleHolder holder = getHolderWithReadline(runtime);
        try {
            holder.readline.redrawLine(); // not quite the same as rl_refresh_line()
        } catch (IOException ioe) {
            throw runtime.newIOErrorFromException(ioe);
        }
        return runtime.getNil();
    }

    public static class HistoryMethods {
View Full Code Here

            sock2.init_sock(runtime, sp[1], "");

            return runtime.newArray(sock, sock2);

        } catch (IOException ioe) {
            throw runtime.newIOErrorFromException(ioe);

        }
    }

    @Override
View Full Code Here

            // TODO: This used to use ChannelStream and honor its buffers; it does not honor OpenFile buffers now
            return runtime.newFixnum(openFile.readChannel().read(buffer));
        } catch (EOFException e) {
            return runtime.newFixnum(-1);
        } catch (IOException e) {
            throw runtime.newIOErrorFromException(e);
        }
    }
}
View Full Code Here

                io.write(str.getByteList().getUnsafeBytes(), str.getByteList().begin(), str.getByteList().length());
            }
           
            return runtime.newFixnum(str.getByteList().length());
        } catch (IOException ioe) {
            throw runtime.newIOErrorFromException(ioe);
        }
    }

    @Override
    @JRubyMethod
View Full Code Here

                } finally {
                    selectable.configureBlocking(oldBlocking);
                }

            } catch(IOException e) {
                throw runtime.newIOErrorFromException(e);
            }
        }
    }

    private void joinMulticastGroup(IRubyObject val) throws IOException, BadDescriptorException {
View Full Code Here

        try {
            IRubyObject result = deflate.deflate(args[0].convertToString().getByteList(), JZlib.Z_FINISH);
            deflate.close();
            return result;
        } catch (IOException ioe) {
            throw runtime.newIOErrorFromException(ioe);
        }
    }

    public JZlibDeflate(Ruby runtime, RubyClass type) {
        super(runtime, type);
View Full Code Here

            }
        } catch(SAXException se) {
            throw RaiseException.createNativeRaiseException(ruby, se);
        } catch(IOException ioe) {
            throw ruby.newIOErrorFromException(ioe);
        }

        postParse(context, handlerRuby, handler);

        //maybeTrimLeadingAndTrailingWhitespace(context, handlerRuby);
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.