Examples of PPFunctionInfo


Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

    Object type = ((Map<?,?>)hash).get("type");
    boolean rValue = "rvalue".equals(type);
   
    Object doc = ((Map<?,?>)hash).get("doc");
    String docString = doc == null ? "" : doc.toString();
    functions.add(new PPFunctionInfo((String)name, rValue, docString));
    return functions;
  }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

    RubyHelper helper = new RubyHelper();
    helper.setUp();
    try {
      List<PPFunctionInfo> foundFunctions = helper.getFunctionInfo(aRubyFile);
      assertEquals("Should have found one function", 1, foundFunctions.size());
      PPFunctionInfo info = foundFunctions.get(0);
      assertEquals("Should have found echotest", "echotest", info.getFunctionName());
      assertTrue("Should have been an rValue", info.isRValue());
    }
    finally {
      helper.tearDown();
    }
  }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

    RubyHelper helper = new RubyHelper();
    helper.setUp();
    try {
      List<PPFunctionInfo> foundFunctions = helper.getFunctionInfo(aRubyFile);
      assertEquals("Should have found one function", 1, foundFunctions.size());
      PPFunctionInfo info = foundFunctions.get(0);
      assertEquals("Should have found echotest", "echotest2", info.getFunctionName());
      assertTrue("Should have been an rValue", info.isRValue());

    }
    finally {
      helper.tearDown();
    }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

    RubyHelper helper = new RubyHelper();
    helper.setUp();
    try {
      List<PPFunctionInfo> foundFunctions = helper.getFunctionInfo(aRubyFile);
      assertEquals("Should have found one function", 1, foundFunctions.size());
      PPFunctionInfo info = foundFunctions.get(0);
      assertEquals("Should have found echotest", "echotest3", info.getFunctionName());
      assertTrue("Should have been an rValue", info.isRValue());

    }
    finally {
      helper.tearDown();
    }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

    RubyHelper helper = new RubyHelper();
    helper.setUp();
    try {
      List<PPFunctionInfo> foundFunctions = helper.getFunctionInfo(aRubyFile);
      assertEquals("Should have found one function", 1, foundFunctions.size());
      PPFunctionInfo info = foundFunctions.get(0);
      assertEquals("Should have found echotest", "docless", info.getFunctionName());
      assertFalse("Should not have been an rValue", info.isRValue());
      assertEquals("Should be no documentation", "", info.getDocumentation());

    }
    finally {
      helper.tearDown();
    }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

    if(!(name instanceof String))
      return functions;

    // Functions can lack rtype and documentation. In that case they just have name
    if(argList.size() == 1) {
      functions.add(new PPFunctionInfo((String) name, false, ""));
      return functions;
    }

    Object hash = argList.get(1);
    if(!(hash instanceof Map<?, ?>))
      return functions;
    Object type = ((Map<?, ?>) hash).get("type");
    boolean rValue = "rvalue".equals(type);
    Object doc = ((Map<?, ?>) hash).get("doc");
    String docString = doc == null
        ? ""
        : doc.toString();

    functions.add(new PPFunctionInfo((String) name, rValue, docString));
    return functions;
  }
View Full Code Here

Examples of com.puppetlabs.geppetto.ruby.PPFunctionInfo

        if("@levels".equals(instAsgn.getName())) {
          Object value = new ConstEvaluator().eval(instAsgn.getValue());
          if(!(value instanceof List<?>))
            return functions;
          for(Object o : (List<?>) value) {
            functions.add(new PPFunctionInfo((String) o, false, "Log a message on the server at level " +
                o + "."));
          }

        }
      }
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.