org.jruby.Ruby.runNormally()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.jruby.Ruby.runNormally方法的一些代码示例,展示了Ruby.runNormally的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.runNormally方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:runNormally

Ruby.runNormally介绍

[英]Run the specified script without any of the loop-processing wrapper code.
[中]在不使用任何循环处理包装器代码的情况下运行指定的脚本。

代码示例

代码示例来源:origin: org.jruby/jruby-complete

/**
 * Run the specified script without any of the loop-processing wrapper
 * code.
 *
 * @param scriptNode The root node of the script to be executed
 * bytecode before execution
 * @return The result of executing the script
 */
public IRubyObject runNormally(Node scriptNode) {
  return runNormally(scriptNode, false);
}

代码示例来源:origin: org.jruby/jruby-core

/**
 * Run the specified script without any of the loop-processing wrapper
 * code.
 *
 * @param scriptNode The root node of the script to be executed
 * bytecode before execution
 * @return The result of executing the script
 */
public IRubyObject runNormally(Node scriptNode) {
  return runNormally(scriptNode, false);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Run the specified script without any of the loop-processing wrapper
 * code.
 *
 * @param scriptNode The root node of the script to be executed
 * bytecode before execution
 * @return The result of executing the script
 */
@Deprecated
public IRubyObject runNormally(Node scriptNode, boolean unused) {
  return runNormally(scriptNode);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Run the specified script without any of the loop-processing wrapper
 * code.
 *
 * @param scriptNode The root node of the script to be executed
 * bytecode before execution
 * @return The result of executing the script
 */
@Deprecated
public IRubyObject runNormally(Node scriptNode, boolean unused) {
  return runNormally(scriptNode);
}

代码示例来源:origin: org.hibnet/webpipes-sass-ruby

IRubyObject result = runtime.runNormally(node);
return new WebpipeOutput(result.toString());

代码示例来源:origin: apache/servicemix-bundles

/**
 * Create a new JRuby-scripted object from the given script source.
 * @param scriptSource the script source text
 * @param interfaces the interfaces that the scripted Java object is to implement
 * @param classLoader the {@link ClassLoader} to create the script proxy with
 * @return the scripted Java object
 * @throws JumpException in case of JRuby parsing failure
 */
public static Object createJRubyObject(String scriptSource, Class<?>[] interfaces, ClassLoader classLoader) {
  Ruby ruby = initializeRuntime();
  Node scriptRootNode = ruby.parseEval(scriptSource, "", null, 0);
  IRubyObject rubyObject = ruby.runNormally(scriptRootNode);
  if (rubyObject instanceof RubyNil) {
    String className = findClassName(scriptRootNode);
    rubyObject = ruby.evalScriptlet("\n" + className + ".new");
  }
  // still null?
  if (rubyObject instanceof RubyNil) {
    throw new IllegalStateException("Compilation of JRuby script returned RubyNil: " + rubyObject);
  }
  return Proxy.newProxyInstance(classLoader, interfaces, new RubyObjectInvocationHandler(rubyObject, ruby));
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

config.isSplit());
} else {
  runNormally(scriptNode);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

config.isSplit());
} else {
  runNormally(scriptNode);

代码示例来源:origin: org.jruby/jruby-core

config.isSplit());
} else {
  runNormally(scriptNode);

代码示例来源:origin: org.jruby/jruby-complete

config.isSplit());
} else {
  runNormally(scriptNode);

代码示例来源:origin: org.jruby/jruby-complete

public void compileAndLoadFile(String filename, InputStream in, boolean wrap) {
  IRubyObject self = wrap ? getTopSelf().rbClone() : getTopSelf();
  ThreadContext context = getCurrentContext();
  InputStream readStream = in;
  String oldFile = context.getFile();
  int oldLine = context.getLine();
  try {
    context.preNodeEval(self);
    ParseResult parseResult = parseFile(filename, in, null);
    RootNode root = (RootNode) parseResult;
    if (wrap) {
      wrapWithModule((RubyBasicObject) self, root);
    } else {
      root.getStaticScope().setModule(getObject());
    }
    runNormally(root, wrap);
  } finally {
    context.postNodeEval();
  }
}

代码示例来源:origin: org.jruby/jruby-core

public void compileAndLoadFile(String filename, InputStream in, boolean wrap) {
  IRubyObject self = wrap ? getTopSelf().rbClone() : getTopSelf();
  ThreadContext context = getCurrentContext();
  InputStream readStream = in;
  String oldFile = context.getFile();
  int oldLine = context.getLine();
  try {
    context.preNodeEval(self);
    ParseResult parseResult = parseFile(filename, in, null);
    RootNode root = (RootNode) parseResult;
    if (wrap) {
      wrapWithModule((RubyBasicObject) self, root);
    } else {
      root.getStaticScope().setModule(getObject());
    }
    runNormally(root, wrap);
  } finally {
    context.postNodeEval();
  }
}

相关文章

微信公众号

最新文章

更多

Ruby类方法