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

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

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

Ruby.getErr介绍

暂无

代码示例

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

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

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

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

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

  1. static void log(Ruby runtime, String msg) {
  2. if (RubyInstanceConfig.DEBUG_LAUNCHING) {
  3. runtime.getErr().println("ShellLauncher: " + msg);
  4. }
  5. }
  6. }

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

  1. static void log(Ruby runtime, String msg) {
  2. if (RubyInstanceConfig.DEBUG_LAUNCHING) {
  3. runtime.getErr().println("ShellLauncher: " + msg);
  4. }
  5. }
  6. }

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

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

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

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

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

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

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

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

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

  1. public JarFile getJarFile(String jarFileName) {
  2. JarFile jarFile = jarFiles.get(jarFileName);
  3. if(null == jarFile) {
  4. try {
  5. jarFile = new JarFile(jarFileName);
  6. jarFiles.put(jarFileName, jarFile);
  7. } catch (ZipException ignored) {
  8. if (runtime.getInstanceConfig().isDebug()) {
  9. LOG.info("ZipException trying to access " + jarFileName + ", stack trace follows:");
  10. ignored.printStackTrace(runtime.getErr());
  11. }
  12. } catch (FileNotFoundException ignored) {
  13. } catch (IOException e) {
  14. throw runtime.newIOErrorFromException(e);
  15. }
  16. }
  17. return jarFile;
  18. }

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

  1. public JarFile getJarFile(String jarFileName) {
  2. JarFile jarFile = jarFiles.get(jarFileName);
  3. if(null == jarFile) {
  4. try {
  5. jarFile = new JarFile(jarFileName);
  6. jarFiles.put(jarFileName, jarFile);
  7. } catch (ZipException ignored) {
  8. if (runtime.getInstanceConfig().isDebug()) {
  9. LOG.info("ZipException trying to access " + jarFileName + ", stack trace follows:");
  10. ignored.printStackTrace(runtime.getErr());
  11. }
  12. } catch (FileNotFoundException ignored) {
  13. } catch (IOException e) {
  14. throw runtime.newIOErrorFromException(e);
  15. }
  16. }
  17. return jarFile;
  18. }

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

  1. @Deprecated
  2. public RubyIO(Ruby runtime, STDIO stdio) {
  3. super(runtime, runtime.getIO());
  4. RubyIO tmp = null;
  5. switch (stdio) {
  6. case IN:
  7. tmp = prepStdio(runtime, runtime.getIn(), Channels.newChannel(runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
  8. break;
  9. case OUT:
  10. tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
  11. break;
  12. case ERR:
  13. tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
  14. break;
  15. }
  16. this.openFile = tmp.openFile;
  17. tmp.openFile = null;
  18. }

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

  1. @Deprecated
  2. public RubyIO(Ruby runtime, STDIO stdio) {
  3. super(runtime, runtime.getIO());
  4. RubyIO tmp = null;
  5. switch (stdio) {
  6. case IN:
  7. tmp = prepStdio(runtime, runtime.getIn(), Channels.newChannel(runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
  8. break;
  9. case OUT:
  10. tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
  11. break;
  12. case ERR:
  13. tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
  14. break;
  15. }
  16. this.openFile = tmp.openFile;
  17. tmp.openFile = null;
  18. }

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

  1. @SuppressWarnings("unchecked")
  2. void doInitialize(final Ruby runtime) {
  3. setOut( runtime.getOut() );
  4. setErr( runtime.getErr() );
  5. rubyENV = runtime.getENV();
  6. compatVersion = runtime.getInstanceConfig().getCompatVersion();
  7. }

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

  1. protected boolean tryLoadingLibraryOrScript(Ruby runtime, SearchState state) {
  2. // attempt to load the found library
  3. try {
  4. state.library.load(runtime, false);
  5. return true;
  6. } catch (MainExitException mee) {
  7. // allow MainExitException to propagate out for exec and friends
  8. throw mee;
  9. } catch (Throwable e) {
  10. if(isJarfileLibrary(state, state.searchFile)) {
  11. return true;
  12. }
  13. reraiseRaiseExceptions(e);
  14. if(runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
  15. RaiseException re = newLoadErrorFromThrowable(runtime, state.searchFile, e);
  16. re.initCause(e);
  17. throw re;
  18. }
  19. }

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

  1. protected boolean tryLoadingLibraryOrScript(Ruby runtime, SearchState state) {
  2. // attempt to load the found library
  3. try {
  4. state.library.load(runtime, false);
  5. return true;
  6. } catch (MainExitException mee) {
  7. // allow MainExitException to propagate out for exec and friends
  8. throw mee;
  9. } catch (Throwable e) {
  10. if(isJarfileLibrary(state, state.searchFile)) {
  11. return true;
  12. }
  13. reraiseRaiseExceptions(e);
  14. if(runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
  15. RaiseException re = newLoadErrorFromThrowable(runtime, state.searchFile, e);
  16. re.initCause(e);
  17. throw re;
  18. }
  19. }

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

  1. public void loadFromClassLoader(ClassLoader classLoader, String file, boolean wrap) {
  2. long startTime = loadTimer.startLoad("classloader:" + file);
  3. try {
  4. SearchState state = new SearchState(file);
  5. state.prepareLoadSearch(file);
  6. Library library = null;
  7. LoadServiceResource resource = getClassPathResource(classLoader, file);
  8. if (resource != null) {
  9. state.loadName = resolveLoadName(resource, file);
  10. library = createLibrary(state, resource);
  11. }
  12. if (library == null) {
  13. throw runtime.newLoadError("no such file to load -- " + file);
  14. }
  15. try {
  16. library.load(runtime, wrap);
  17. } catch (IOException e) {
  18. if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
  19. throw newLoadErrorFromThrowable(runtime, file, e);
  20. }
  21. } finally {
  22. loadTimer.endLoad("classloader:" + file, startTime);
  23. }
  24. }

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

  1. public void loadFromClassLoader(ClassLoader classLoader, String file, boolean wrap) {
  2. long startTime = loadTimer.startLoad("classloader:" + file);
  3. try {
  4. SearchState state = new SearchState(file);
  5. state.prepareLoadSearch(file);
  6. Library library = null;
  7. LoadServiceResource resource = getClassPathResource(classLoader, file);
  8. if (resource != null) {
  9. state.loadName = resolveLoadName(resource, file);
  10. library = createLibrary(state, resource);
  11. }
  12. if (library == null) {
  13. throw runtime.newLoadError("no such file to load -- " + file);
  14. }
  15. try {
  16. library.load(runtime, wrap);
  17. } catch (IOException e) {
  18. if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
  19. throw newLoadErrorFromThrowable(runtime, file, e);
  20. }
  21. } finally {
  22. loadTimer.endLoad("classloader:" + file, startTime);
  23. }
  24. }

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

  1. public void load(String file, boolean wrap) {
  2. long startTime = loadTimer.startLoad(file);
  3. try {
  4. if(!runtime.getProfile().allowLoad(file)) {
  5. throw runtime.newLoadError("no such file to load -- " + file, file);
  6. }
  7. SearchState state = new SearchState(file);
  8. state.prepareLoadSearch(file);
  9. Library library = findBuiltinLibrary(state, state.searchFile, state.suffixType);
  10. if (library == null) library = findLibraryWithoutCWD(state, state.searchFile, state.suffixType);
  11. if (library == null) {
  12. library = findLibraryWithClassloaders(state, state.searchFile, state.suffixType);
  13. if (library == null) {
  14. throw runtime.newLoadError("no such file to load -- " + file, file);
  15. }
  16. }
  17. try {
  18. library.load(runtime, wrap);
  19. } catch (IOException e) {
  20. if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
  21. throw newLoadErrorFromThrowable(runtime, file, e);
  22. }
  23. } finally {
  24. loadTimer.endLoad(file, startTime);
  25. }
  26. }

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

  1. public void load(String file, boolean wrap) {
  2. long startTime = loadTimer.startLoad(file);
  3. try {
  4. if(!runtime.getProfile().allowLoad(file)) {
  5. throw runtime.newLoadError("no such file to load -- " + file, file);
  6. }
  7. SearchState state = new SearchState(file);
  8. state.prepareLoadSearch(file);
  9. Library library = findBuiltinLibrary(state, state.searchFile, state.suffixType);
  10. if (library == null) library = findLibraryWithoutCWD(state, state.searchFile, state.suffixType);
  11. if (library == null) {
  12. library = findLibraryWithClassloaders(state, state.searchFile, state.suffixType);
  13. if (library == null) {
  14. throw runtime.newLoadError("no such file to load -- " + file, file);
  15. }
  16. }
  17. try {
  18. library.load(runtime, wrap);
  19. } catch (IOException e) {
  20. if (runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
  21. throw newLoadErrorFromThrowable(runtime, file, e);
  22. }
  23. } finally {
  24. loadTimer.endLoad(file, startTime);
  25. }
  26. }

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

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

相关文章

Ruby类方法