Examples of callMethod()


Examples of org.jruby.RubyString.callMethod()

        // quoted = string.gsub("'", "''")
        RubyString quoted = quoteCharWith(context, str, '\'', '\'');

        if ( ! standard_conforming_strings(context, self) ) { // minor branch
            // quoted.gsub!(/\\/, '\&\&')
            return quoted.callMethod(context, "gsub", new IRubyObject[] {
                context.runtime.newString(BYTES_BACKSLASH),
                context.runtime.newString(BYTES_ANDAND)
            });
        }
        return quoted;
View Full Code Here

Examples of org.jruby.embed.EmbedRubyObjectAdapter.callMethod()

    public Object call(Object recv, String method, Object[] args) throws BSFException {
        try {
            EmbedRubyObjectAdapter adapter = container.newObjectAdapter();
            if (args == null) {
                return adapter.callMethod(recv, method, Object.class);
            } else {
                return adapter.callMethod(recv, method, args, Object.class);
            }
        } catch (Exception excptn) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, excptn.getMessage(), excptn);
View Full Code Here

Examples of org.jruby.embed.ScriptingContainer.callMethod()

            long beginTime = System.currentTimeMillis();
      try
      {
        Object app = container.runScriptlet("Sipatra::Application::new");

        container.callMethod(app, "set_bindings", new Object[] {
            message.getSession().getServletContext()
            message.getSession().getServletContext().getAttribute(SipServlet.SIP_FACTORY),
            message.getSession(),
            message, _log});
        container.callMethod(app, methodName);
View Full Code Here

Examples of org.jruby.embed.ScriptingContainer.callMethod()

        container.callMethod(app, "set_bindings", new Object[] {
            message.getSession().getServletContext()
            message.getSession().getServletContext().getAttribute(SipServlet.SIP_FACTORY),
            message.getSession(),
            message, _log});
        container.callMethod(app, methodName);
      }
      catch(Exception e)
      {
        pool.invalidateObject(container);
        container = null;
View Full Code Here

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

    @JRubyMethod(name = "getc", module = true, visibility = PRIVATE)
    public static IRubyObject getc(ThreadContext context, IRubyObject recv) {
        context.getRuntime().getWarnings().warn(ID.DEPRECATED_METHOD, "getc is obsolete; use STDIN.getc instead", "getc", "STDIN.getc");
        IRubyObject defin = context.getRuntime().getGlobalVariables().get("$stdin");
        return defin.callMethod(context, "getc");
    }

    @JRubyMethod(name = "gets", optional = 1, module = true, visibility = PRIVATE)
    public static IRubyObject gets(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
        return RubyArgsFile.gets(context, context.getRuntime().getGlobalVariables().get("$<"), args);
View Full Code Here

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

        Ruby runtime = context.getRuntime();
        IRubyObject defout = runtime.getGlobalVariables().get("$>");

        for (int i = 0; i < args.length; i++) {
            if (args[i] != null) {
                defout.callMethod(context, "write", RubyObject.inspect(context, args[i]));
                defout.callMethod(context, "write", runtime.newString("\n"));
            }
        }

        IRubyObject result = runtime.getNil();
View Full Code Here

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

        IRubyObject defout = runtime.getGlobalVariables().get("$>");

        for (int i = 0; i < args.length; i++) {
            if (args[i] != null) {
                defout.callMethod(context, "write", RubyObject.inspect(context, args[i]));
                defout.callMethod(context, "write", runtime.newString("\n"));
            }
        }

        IRubyObject result = runtime.getNil();
        if (runtime.getInstanceConfig().getCompatVersion() == CompatVersion.RUBY1_9) {
View Full Code Here

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

    /** rb_f_putc
     */
    @JRubyMethod(name = "putc", required = 1, module = true, visibility = PRIVATE)
    public static IRubyObject putc(ThreadContext context, IRubyObject recv, IRubyObject ch) {
        IRubyObject defout = context.getRuntime().getGlobalVariables().get("$>");
        return defout.callMethod(context, "putc", ch);
    }

    @JRubyMethod(name = "puts", rest = true, module = true, visibility = PRIVATE)
    public static IRubyObject puts(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
        IRubyObject defout = context.getRuntime().getGlobalVariables().get("$>");
View Full Code Here

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

    @JRubyMethod(name = "puts", rest = true, module = true, visibility = PRIVATE)
    public static IRubyObject puts(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
        IRubyObject defout = context.getRuntime().getGlobalVariables().get("$>");
       
        defout.callMethod(context, "puts", args);

        return context.getRuntime().getNil();
    }

    @JRubyMethod(name = "print", rest = true, module = true, visibility = PRIVATE)
View Full Code Here

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

    @JRubyMethod(name = "print", rest = true, module = true, visibility = PRIVATE)
    public static IRubyObject print(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
        IRubyObject defout = context.getRuntime().getGlobalVariables().get("$>");

        defout.callMethod(context, "print", args);

        return context.getRuntime().getNil();
    }

    @JRubyMethod(name = "printf", rest = true, module = true, visibility = PRIVATE)
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.