find_pager_jruby(pager)
public
Finds the given pager for jruby. Returns an IO if pager was found.
Returns false if pager does not exist.
Returns nil if the jruby JVM doesn’t support ProcessBuilder redirection
(1.6 and older).
# File lib/rdoc/ri/driver.rb, line 1013
def find_pager_jruby pager
require 'java'
require 'shellwords'
return nil unless java.lang.ProcessBuilder.constants.include? :Redirect
pager = Shellwords.split pager
pb = java.lang.ProcessBuilder.new(*pager)
pb = pb.redirect_output java.lang.ProcessBuilder::Redirect::INHERIT
@jruby_pager_process = pb.start
input = @jruby_pager_process.output_stream
io = input.to_io
io.sync = true
io
rescue java.io.IOException
false
end