Examples of evalScriptlet()


Examples of org.jruby.Ruby.evalScriptlet()

        if("main_ruby_file".equals(parts[0].replaceAll(" ", ""))) {
            mainRubyFile = parts[1].replaceAll(" ", "");
        }
    }

    runtime.evalScriptlet("require '" + mainRubyFile + "'");
  }

  public static URL getResource(String path) {
      return Main.class.getClassLoader().getResource(path);
  }
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

      if("source_dirs".equals(parts[0].replaceAll(" ", ""))) {
        String[] source_dirs = parts[1].split(";");
        for(String s : parts[1].split(";") ){
          String d = s.replaceAll(" ", "");
          runtime.evalScriptlet( "$: << '"+d+"/'" );
        }
      }
    }
    runtime.evalScriptlet("require '" + mainRubyFile + "'");
  }
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

          String d = s.replaceAll(" ", "");
          runtime.evalScriptlet( "$: << '"+d+"/'" );
        }
      }
    }
    runtime.evalScriptlet("require '" + mainRubyFile + "'");
  }

  public static URL getResource(String path) {
      return Main.class.getClassLoader().getResource(path);
  }
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

     */
    public static void main(String[] args) {
        RubyInstanceConfig config = new RubyInstanceConfig();
        Ruby runtime = Ruby.newInstance(config);
        runtime.getLoadService().init(new ArrayList(0));
  runtime.evalScriptlet("require 'src/main.rb'");
    }

}
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

      "  require main_file\n" +
      "rescue LoadError => e\n" +
      "  warn 'Error starting the application'\n" +
      "  warn \"#{e}\\n#{e.backtrace.join(\"\\n\")}\"\n" +
      "end\n";
    runtime.evalScriptlet(bootRuby);
  }

  public static URL getResource(String path) {
    return Main.class.getClassLoader().getResource(path);
  }
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

            Ruby interpreter = script.getInterpreter();
            assertTrue("Collector not defined", interpreter.isClassDefined("Collector"));
            RubyClass collectorClass = interpreter.getClass("Collector");
            IRubyObject presult = JavaEmbedUtils.javaToRuby(interpreter, result);
            IRubyObject collector = collectorClass.newInstance(interpreter.getCurrentContext(), new IRubyObject[0], null);
            IRubyObject rubyObject = interpreter.evalScriptlet("proc { my_function }");
            try {
                collector.callMethod(interpreter.getCurrentContext(), "callprotected", new IRubyObject[] { rubyObject, presult });
            } catch (Throwable t) {

            }
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

        Ruby interpreter = script.getInterpreter();
        assertTrue("Collector not defined", interpreter.isClassDefined("Collector"));
        RubyClass collectorClass = interpreter.getClass("Collector");
        IRubyObject presult = JavaEmbedUtils.javaToRuby(interpreter, result);
        IRubyObject collector = collectorClass.newInstance(interpreter.getCurrentContext(), new IRubyObject[0], null);
        IRubyObject rubyObject = interpreter.evalScriptlet("proc { my_function }");
        try {
            collector.callMethod(interpreter.getCurrentContext(), "callprotected", new IRubyObject[] { rubyObject, presult });
        } catch (Throwable t) {

        }
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

        tar.hookIntoRuntime(runtime);

        Thread t2 = new Thread() {
            public void run() {
                console.setVisible(true);
                runtime.evalScriptlet(
                        "ARGV << '--readline' << '--prompt' << 'inf-ruby';"
                        + "require 'irb'; require 'irb/completion';"
                        + "IRB.start");
            }
        };
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

        // warmup JVM first
        Ruby ruby = Ruby.newInstance();

        String envWarmup = System.getenv(JRUBY_DRIP_WARMUP_ENV);
        if (envWarmup != null && envWarmup.length() > 0) {
            ruby.evalScriptlet(envWarmup);
        } else {
            ruby.evalScriptlet(JRUBY_DRIP_WARMUP_DEFAULT);
        }

        // preboot actual runtime
View Full Code Here

Examples of org.jruby.Ruby.evalScriptlet()

        String envWarmup = System.getenv(JRUBY_DRIP_WARMUP_ENV);
        if (envWarmup != null && envWarmup.length() > 0) {
            ruby.evalScriptlet(envWarmup);
        } else {
            ruby.evalScriptlet(JRUBY_DRIP_WARMUP_DEFAULT);
        }

        // preboot actual runtime
        Ruby.clearGlobalRuntime();
        File dripMain = new File(JRUBY_DRIP_PREBOOT_FILE);
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.