Examples of RubyObject


Examples of org.jruby.RubyObject

            for(int i=0,j=nms.length;i<j;i++) {
                objClass = (RubyModule)objClass.getConstant(nms[i]);
            }
        }
        final RubyClass theCls = (RubyClass)objClass;
        final RubyObject oo = (RubyObject)theCls.getAllocator().allocate(runtime, theCls);
        final List vars = (List)(ctor.constructSequence(node));
        for(final Iterator iter = vars.iterator();iter.hasNext();) {
            RuntimeHelpers.invoke(oo.getRuntime().getCurrentContext(), oo, "<<", (IRubyObject)iter.next());
        }
        return oo;
    }
View Full Code Here

Examples of org.jruby.RubyObject

      RubySymbol className = (RubySymbol)unmarshalObject();
     
      RubyClass type = (RubyClass)runtime.getClassFromPath(className.asJavaString());
     
        // All "C" marshalled objects descend from core classes, which are all RubyObject
      RubyObject result = (RubyObject)unmarshalObject();
     
      result.setMetaClass(type);
     
      return result;
    }
View Full Code Here

Examples of org.jruby.RubyObject

  Ruby runtime = null;
  RubyArray rv = null;

  void pass_through(String str) {
    RubyObject last = ((RubyObject)rv.last());
    if ( rv.size() > 0 &&  last != null && (last instanceof RubyString) ){
      // XXX concat changes for ruby 1.9
      ((RubyString) last).concat(RubyString.newString(runtime, str));
    } else {
      rv.append(RubyString.newString(runtime, str));
View Full Code Here

Examples of org.jruby.RubyObject

    newEnv.put("VAGRANT_LOG", "DEBUG");
    scriptingContainer.setEnvironment(newEnv);
  }
 
  public VagrantEnvironment createEnvironment() {
    RubyObject vagrantEnv = (RubyObject) scriptingContainer.runScriptlet("require 'rubygems'\n"
        + "require 'vagrant'\n"
        + "\n" + "return Vagrant::Environment.new");
    return new VagrantEnvironment(vagrantEnv);
  }
View Full Code Here

Examples of org.jruby.RubyObject

        + "\n" + "return Vagrant::Environment.new");
    return new VagrantEnvironment(vagrantEnv);
  }
 
  public VagrantEnvironment createEnvironment(File path) {
    RubyObject vagrantEnv = (RubyObject) scriptingContainer.runScriptlet("require 'rubygems'\n"
        + "require 'vagrant'\n"
        + "\n" + "return Vagrant::Environment.new(:cwd => '" + path.getAbsolutePath() + "')");
    return new VagrantEnvironment(vagrantEnv);
  }
View Full Code Here

Examples of org.jruby.RubyObject

   * If this environment is a single VM environment (only contains one VM) this methode will return the VM object.
   * @return the object for the VM in this environment.
   */
  public VagrantVm getPrimaryVm() {
    try {
      RubyObject rubyVm = (RubyObject) vagrantEnvironment.callMethod("primary_vm");
      if(rubyVm == null || rubyVm instanceof RubyNil) {
        throw new VagrantException("No primary vm found. Maybe there is no vm defined in your configuration or you are working with a multi vm environment.");
      }
      return new VagrantVm(rubyVm);
    } catch (RaiseException exception) {
View Full Code Here

Examples of org.jruby.RubyObject

        if (vars.isLazy()) return;
        // user defined constants of top level go to a super class
        updateConstantsOfSuperClass(receiver, vars);
        // Constants might have the same names but different receivers.
        updateConstants(receiver, vars);
        RubyObject topSelf = (RubyObject)receiver.getRuntime().getTopSelf();
        updateConstants(topSelf, vars);
    }
View Full Code Here

Examples of org.jruby.RubyObject

    public static void retrieve(RubyObject receiver, BiVariableMap vars) {
        if (vars.isLazy()) return;
        // trying to get variables from receiver;
        updateClassVar(receiver, vars);
        // trying to get variables from topself.
        RubyObject topSelf = (RubyObject) receiver.getRuntime().getTopSelf();
        updateClassVar(topSelf, vars);
    }
View Full Code Here

Examples of org.jruby.RubyObject

        super(name);
    }

    public void setUp() {
        runtime = Ruby.newInstance();
        rubyObject = new RubyObject(runtime, runtime.getObject());
    }
View Full Code Here

Examples of org.jruby.RubyObject

    // player?
    if (RubyHelper.toInt(e.getParameters().get(0)) == -1) {
      s = "Player";
      // has a map?
    } else {
      RubyObject map = e.getYecl().getMap();
      if (map != null) {
        // get all events
        RubyHash ra = (RubyHash) map.getInstanceVariable("@events");

        s = new SystemGObject((RubyObject) ra.get(e.getParameters().get(0))).getName();
      }
    }
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.