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

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

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

Ruby.getErr介绍

暂无

代码示例

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

static void log(Ruby runtime, String msg) {
  if (RubyInstanceConfig.DEBUG_LAUNCHING) {
    runtime.getErr().println("ShellLauncher: " + msg);
  }
}

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

static void log(Ruby runtime, String msg) {
  if (RubyInstanceConfig.DEBUG_LAUNCHING) {
    runtime.getErr().println("ShellLauncher: " + msg);
  }
}

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

static void log(Ruby runtime, String msg) {
    if (RubyInstanceConfig.DEBUG_LAUNCHING) {
      runtime.getErr().println("ShellLauncher: " + msg);
    }
  }
}

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

static void log(Ruby runtime, String msg) {
    if (RubyInstanceConfig.DEBUG_LAUNCHING) {
      runtime.getErr().println("ShellLauncher: " + msg);
    }
  }
}

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

private void checkGlobChar(String word) {
  if (Options.LAUNCH_INPROC.load() &&
      (word.contains("*")
      || word.contains("?")
      || word.contains("[")
      || word.contains("{"))) {
    runtime.getErr().println("Warning: treating '" + word + "' literally."
        + " Consider passing -J-Djruby.launch.inproc=false.");
  }
}

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

private void checkGlobChar(String word) {
  if (Options.LAUNCH_INPROC.load() &&
      (word.contains("*")
      || word.contains("?")
      || word.contains("[")
      || word.contains("{"))) {
    runtime.getErr().println("Warning: treating '" + word + "' literally."
        + " Consider passing -J-Djruby.launch.inproc=false.");
  }
}

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

private static void debugLoadException(final Ruby runtime, final Throwable ex) {
  if (runtime.isDebug()) ex.printStackTrace(runtime.getErr());
}

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

private static void debugLoadException(final Ruby runtime, final Throwable ex) {
  if (runtime.isDebug()) ex.printStackTrace(runtime.getErr());
}

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

public JarFile getJarFile(String jarFileName) {
  JarFile jarFile = jarFiles.get(jarFileName);
  if(null == jarFile) {
    try {
      jarFile = new JarFile(jarFileName);
      jarFiles.put(jarFileName, jarFile);
    } catch (ZipException ignored) {
      if (runtime.getInstanceConfig().isDebug()) {
        LOG.info("ZipException trying to access " + jarFileName + ", stack trace follows:");
        ignored.printStackTrace(runtime.getErr());
      }
    } catch (FileNotFoundException ignored) {
    } catch (IOException e) {
      throw runtime.newIOErrorFromException(e);
    }
  }
  return jarFile;
}

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

public JarFile getJarFile(String jarFileName) {
  JarFile jarFile = jarFiles.get(jarFileName);
  if(null == jarFile) {
    try {
      jarFile = new JarFile(jarFileName);
      jarFiles.put(jarFileName, jarFile);
    } catch (ZipException ignored) {
      if (runtime.getInstanceConfig().isDebug()) {
        LOG.info("ZipException trying to access " + jarFileName + ", stack trace follows:");
        ignored.printStackTrace(runtime.getErr());
      }
    } catch (FileNotFoundException ignored) {
    } catch (IOException e) {
      throw runtime.newIOErrorFromException(e);
    }
  }
  return jarFile;
}

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

@Deprecated
public RubyIO(Ruby runtime, STDIO stdio) {
  super(runtime, runtime.getIO());
  RubyIO tmp = null;
  switch (stdio) {
    case IN:
      tmp = prepStdio(runtime, runtime.getIn(), Channels.newChannel(runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
      break;
    case OUT:
      tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
      break;
    case ERR:
      tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
      break;
  }
  this.openFile = tmp.openFile;
  tmp.openFile = null;
}

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

@Deprecated
public RubyIO(Ruby runtime, STDIO stdio) {
  super(runtime, runtime.getIO());
  RubyIO tmp = null;
  switch (stdio) {
    case IN:
      tmp = prepStdio(runtime, runtime.getIn(), Channels.newChannel(runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
      break;
    case OUT:
      tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
      break;
    case ERR:
      tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
      break;
  }
  this.openFile = tmp.openFile;
  tmp.openFile = null;
}

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

@SuppressWarnings("unchecked")
void doInitialize(final Ruby runtime) {
  setOut( runtime.getOut() );
  setErr( runtime.getErr() );
  rubyENV = runtime.getENV();
  compatVersion = runtime.getInstanceConfig().getCompatVersion();
}

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

protected boolean tryLoadingLibraryOrScript(Ruby runtime, SearchState state) {
  // attempt to load the found library
  try {
    state.library.load(runtime, false);
    return true;
  } catch (MainExitException mee) {
    // allow MainExitException to propagate out for exec and friends
    throw mee;
  } catch (Throwable e) {
    if(isJarfileLibrary(state, state.searchFile)) {
      return true;
    }
    reraiseRaiseExceptions(e);
    if(runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
    RaiseException re = newLoadErrorFromThrowable(runtime, state.searchFile, e);
    re.initCause(e);
    throw re;
  }
}

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

protected boolean tryLoadingLibraryOrScript(Ruby runtime, SearchState state) {
  // attempt to load the found library
  try {
    state.library.load(runtime, false);
    return true;
  } catch (MainExitException mee) {
    // allow MainExitException to propagate out for exec and friends
    throw mee;
  } catch (Throwable e) {
    if(isJarfileLibrary(state, state.searchFile)) {
      return true;
    }
    reraiseRaiseExceptions(e);
    if(runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
    RaiseException re = newLoadErrorFromThrowable(runtime, state.searchFile, e);
    re.initCause(e);
    throw re;
  }
}

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

public void loadFromClassLoader(ClassLoader classLoader, String file, boolean wrap) {
  long startTime = loadTimer.startLoad("classloader:" + file);
  try {
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = null;
    LoadServiceResource resource = getClassPathResource(classLoader, file);
    if (resource != null) {
      state.loadName = resolveLoadName(resource, file);
      library = createLibrary(state, resource);
    }
    if (library == null) {
      throw runtime.newLoadError("no such file to load -- " + file);
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    loadTimer.endLoad("classloader:" + file, startTime);
  }
}

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

public void loadFromClassLoader(ClassLoader classLoader, String file, boolean wrap) {
  long startTime = loadTimer.startLoad("classloader:" + file);
  try {
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = null;
    LoadServiceResource resource = getClassPathResource(classLoader, file);
    if (resource != null) {
      state.loadName = resolveLoadName(resource, file);
      library = createLibrary(state, resource);
    }
    if (library == null) {
      throw runtime.newLoadError("no such file to load -- " + file);
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    loadTimer.endLoad("classloader:" + file, startTime);
  }
}

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

public void load(String file, boolean wrap) {
  long startTime = loadTimer.startLoad(file);
  try {
    if(!runtime.getProfile().allowLoad(file)) {
      throw runtime.newLoadError("no such file to load -- " + file, file);
    }
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = findBuiltinLibrary(state, state.searchFile, state.suffixType);
    if (library == null) library = findLibraryWithoutCWD(state, state.searchFile, state.suffixType);
    if (library == null) {
      library = findLibraryWithClassloaders(state, state.searchFile, state.suffixType);
      if (library == null) {
        throw runtime.newLoadError("no such file to load -- " + file, file);
      }
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    loadTimer.endLoad(file, startTime);
  }
}

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

public void load(String file, boolean wrap) {
  long startTime = loadTimer.startLoad(file);
  try {
    if(!runtime.getProfile().allowLoad(file)) {
      throw runtime.newLoadError("no such file to load -- " + file, file);
    }
    SearchState state = new SearchState(file);
    state.prepareLoadSearch(file);
    Library library = findBuiltinLibrary(state, state.searchFile, state.suffixType);
    if (library == null) library = findLibraryWithoutCWD(state, state.searchFile, state.suffixType);
    if (library == null) {
      library = findLibraryWithClassloaders(state, state.searchFile, state.suffixType);
      if (library == null) {
        throw runtime.newLoadError("no such file to load -- " + file, file);
      }
    }
    try {
      library.load(runtime, wrap);
    } catch (IOException e) {
      if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
      throw newLoadErrorFromThrowable(runtime, file, e);
    }
  } finally {
    loadTimer.endLoad(file, startTime);
  }
}

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

runtime, runtime.getOut(), new NativeDeviceChannel(1), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
  stderr = RubyIO.prepStdio(
      runtime, runtime.getErr(), new NativeDeviceChannel(2), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
} else {
  stdin = RubyIO.prepStdio(
      runtime, runtime.getOut(), prepareStdioChannel(runtime, STDIO.OUT, runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
  stderr = RubyIO.prepStdio(
      runtime, runtime.getErr(), prepareStdioChannel(runtime, STDIO.ERR, runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");

相关文章

Ruby类方法