[前][次][番号順一覧][スレッド一覧]

ruby-changes:72056

From: Nobuyoshi <ko1@a...>
Date: Sat, 4 Jun 2022 16:42:21 +0900 (JST)
Subject: [ruby-changes:72056] 9a7be959b1 (master): [ruby/rdoc] Remove `RDoc::RI::Driver#in_path?`

https://git.ruby-lang.org/ruby.git/commit/?id=9a7be959b1

From 9a7be959b1bf9a43e3436246a29db3a4d0f3f352 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 4 Jun 2022 16:14:26 +0900
Subject: [ruby/rdoc] Remove `RDoc::RI::Driver#in_path?`

https://github.com/ruby/rdoc/commit/83051403d6
---
 lib/rdoc/ri/driver.rb            | 11 -----------
 test/rdoc/test_rdoc_ri_driver.rb | 17 -----------------
 2 files changed, 28 deletions(-)

diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index f7a7d84205..610d78ae68 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -1141,17 +1141,6 @@ or the PAGER environment variable. https://github.com/ruby/ruby/blob/trunk/lib/rdoc/ri/driver.rb#L1141
     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.
diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb
index 18f92d0168..c23fe63130 100644
--- a/test/rdoc/test_rdoc_ri_driver.rb
+++ b/test/rdoc/test_rdoc_ri_driver.rb
@@ -1091,23 +1091,6 @@ Foo::Bar#bother https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_ri_driver.rb#L1091
     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('.')
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]