Package org.jruby

Examples of org.jruby.RubyArray.addAll()


    }
   
    private void updateArgvByJavaObject() {
        RubyArray ary = RubyArray.newArray(receiver.getRuntime());
        if (javaObject instanceof Collection) {
            ary.addAll((Collection)javaObject);
        } else if (javaObject instanceof String[]) {
            for (String s : (String[])javaObject) {
                ary.add(s);
            }
        }
View Full Code Here


    }
   
    private void updateArgvByJavaObject() {
        RubyArray ary = RubyArray.newArray(receiver.getRuntime());
        if (javaObject instanceof Collection) {
            ary.addAll((Collection)javaObject);
        } else if (javaObject instanceof String[]) {
            for (String s : (String[])javaObject) {
                ary.add(s);
            }
        }
View Full Code Here

  }
 
  private RubyArray customBacktrace(ThreadContext context) {
    Frame[] frames = context.createBacktrace(1, false);
    RubyArray ary = context.getRuntime().newArray();
    ary.addAll(formatBacktrace(context.getRuntime(), frames[frames.length - 1]));
    return context.getRuntime().newArray((IRubyObject) ary);
  }
 
  /*
   * TODO: The logic in this method really needs to be wrapped in a backtrace
View Full Code Here

        Reader reader = null;
        try {
            reader = new FileReader(filename);
            List list = (List) Util.readAll(reader);
            RubyArray array = RubyArray.newArray(context.getRuntime(), list.size());
            array.addAll(list);
            return array;
        } catch (Exception e) {
            throw context.getRuntime().newRuntimeError(e.getMessage());
        } finally {
            try {
View Full Code Here

    }
   
    private void updateArgvByJavaObject() {
        RubyArray ary = RubyArray.newArray(receiver.getRuntime());
        if (javaObject instanceof Collection) {
            ary.addAll((Collection)javaObject);
        } else if (javaObject instanceof String[]) {
            for (String s : (String[])javaObject) {
                ary.add(s);
            }
        }
View Full Code Here

    return hash;
  }

  private RubyArray convertToRubyArray(List<Integer> list) {
    RubyArray array = RubyArray.newEmptyArray(runtime);
    array.addAll(list);
    return array;
  }

  private RubyArray callRackApplication(RubyHash rubyHash) {
    return (RubyArray) application.callMethod(threadService.getCurrentContext(), "call", rubyHash);
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.