зеркало из https://github.com/github/ruby.git
[ruby/rdoc] Remove `RDoc::RI::Driver#in_path?`
https://github.com/ruby/rdoc/commit/83051403d6
This commit is contained in:
Родитель
d4c7e4d5bb
Коммит
9a7be959b1
|
@ -1141,17 +1141,6 @@ or the PAGER environment variable.
|
|||
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.
|
||||
|
|
|
@ -1091,23 +1091,6 @@ Foo::Bar#bother
|
|||
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('.')
|
||||
|
|
Загрузка…
Ссылка в новой задаче