Skip to content

Commit

Permalink
Merge pull request #886 from nobu/no-pager-check
Browse files Browse the repository at this point in the history
No pager check
  • Loading branch information
nobu committed Jun 4, 2022
2 parents 0d4783d + 8305140 commit 7103f92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
15 changes: 0 additions & 15 deletions lib/rdoc/ri/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1141,17 +1141,6 @@ def interactive
exit
end

##
# Is +file+ in ENV['PATH']?

def in_path? file
return true if file =~ %r%\A/% and File.exist? file

ENV['PATH'].split(File::PATH_SEPARATOR).any? do |path|
File.exist? File.join(path, file)
end
end

##
# Lists classes known to ri starting with +names+. If +names+ is empty all
# known classes are shown.
Expand Down Expand Up @@ -1521,10 +1510,6 @@ def setup_pager
pagers.compact.uniq.each do |pager|
next unless pager

pager_cmd = pager.split(' ').first

next unless in_path? pager_cmd

if jruby then
case io = find_pager_jruby(pager)
when nil then break
Expand Down
25 changes: 3 additions & 22 deletions test/rdoc/test_rdoc_ri_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1091,23 +1091,6 @@ def tty.tty?() true; end
assert_instance_of @RM::ToBs, driver.formatter(StringIO.new)
end

def test_in_path_eh
path = ENV['PATH']

test_path = File.expand_path '..', __FILE__

temp_dir do |dir|
nonexistent = File.join dir, 'nonexistent'
refute @driver.in_path?(nonexistent)

ENV['PATH'] = test_path

assert @driver.in_path?(File.basename(__FILE__))
end
ensure
ENV['PATH'] = path
end

def test_method_type
assert_equal :both, @driver.method_type(nil)
assert_equal :both, @driver.method_type('.')
Expand Down Expand Up @@ -1246,7 +1229,7 @@ def test_load_method_missing
assert_equal '(unknown)#inherit', method.full_name
end

def _test_page # this test doesn't do anything anymore :(
def test_page
@driver.use_stdout = false

with_dummy_pager do
Expand All @@ -1260,9 +1243,7 @@ def _test_page # this test doesn't do anything anymore :(
refute @driver.paging?
end

# this test is too fragile. Perhaps using Process.spawn will make this
# reliable
def _test_page_in_presence_of_child_status
def test_page_in_presence_of_child_status
@driver.use_stdout = false

with_dummy_pager do
Expand Down Expand Up @@ -1425,7 +1406,7 @@ def test_parse_name_special
end
end

def _test_setup_pager # this test doesn't do anything anymore :(
def test_setup_pager # this test doesn't do anything anymore :(
@driver.use_stdout = false

pager = with_dummy_pager do @driver.setup_pager end
Expand Down

0 comments on commit 7103f92

Please sign in to comment.