Package org.jruby

Examples of org.jruby.Ruby.evalScriptlet()


    public static Object constructRubyRegexp(final Constructor ctor, final Node node) {
        final Ruby runtime = ((JRubyConstructor)ctor).runtime;
        String s1 = ctor.constructScalar(node).toString();
        // This should be fixed in some way
        return runtime.evalScriptlet(s1);
    }

    public static Object constructRubyRange(final Constructor ctor, final Node node) {
        final Ruby runtime = ((JRubyConstructor)ctor).runtime;
        ThreadContext context = runtime.getCurrentContext();
View Full Code Here


      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

          runtime.evalScriptlet( "$: << '"+d+"/'" );
        }
      }
    }

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

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

        tar.hookIntoRuntime(runtime);

        Thread t2 = new Thread() {
            public void run() {
                console.setVisible(true);
                runtime.evalScriptlet("require 'irb'; require 'irb/completion'; IRB.start");
            }
        };
        t2.start();

        try {
View Full Code Here

              hasArgs = true;
        }

        if(isArray && hasArgs){
                 Ruby runtime = Ruby.getDefaultInstance();
                 IRubyObject ob =runtime.evalScriptlet(script +getMethodHeader(methodName)+getParamHeader((Object[])args));
                 return ob;
        }
        else if(!hasArgs){

                 Ruby runtime = Ruby.getDefaultInstance();
View Full Code Here

                 return ob;
        }
        else if(!hasArgs){

                 Ruby runtime = Ruby.getDefaultInstance();
                 IRubyObject ob =runtime.evalScriptlet(script +getMethodHeader(methodName));
                 return ob;
        }
        else if(argLen<=0){

                 Ruby runtime = Ruby.getDefaultInstance();
View Full Code Here

                 return ob;
        }
        else if(argLen<=0){

                 Ruby runtime = Ruby.getDefaultInstance();
                 IRubyObject ob =runtime.evalScriptlet(script +getMethodHeader(methodName));
                 return ob;
        }
       }
       catch(Exception e){
              throw new AxisFault("Could not invoke the method requested.",e);
View Full Code Here

        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

        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

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

  public static URL getResource(String path) {
    return Main.class.getClassLoader().getResource(path);
  }
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.