Skip to content

Commit 998bb18

Browse files
committed
Remove FileTest.exists? alias to exist? method
1 parent 5b848b1 commit 998bb18

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Compatibility:
4545
* Support passing anonymous * and ** parameters as method call arguments (#3039, @andrykonchin).
4646
* Handle either positional or keywords arguments by default in `Struct.new` (#3039, @rwstauner).
4747
* Remove deprecated methods `Dir.exists?`, `File.exists?`, and `Kernel#=~` (#3039, @patricklinpl, @nirvdrum).
48+
* Remove deprecated `FileTest.exists?` method (#3039, @andrykonchin).
4849

4950
Performance:
5051

spec/ruby/core/filetest/exist_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@
44
describe "FileTest.exist?" do
55
it_behaves_like :file_exist, :exist?, FileTest
66
end
7+
8+
ruby_version_is "3.2" do
9+
describe "FileTest.exists?" do
10+
it "has been removed" do
11+
FileTest.should_not.respond_to?(:exists?)
12+
end
13+
end
14+
end

src/main/ruby/truffleruby/core/file_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def executable_real?(path)
5050
def exist?(path)
5151
File.exist? path
5252
end
53-
alias_method :exists?, :exist?
5453

5554
def file?(path)
5655
File.file? path
@@ -126,7 +125,6 @@ def zero?(path)
126125
:executable?,
127126
:executable_real?,
128127
:exist?,
129-
:exists?,
130128
:file?,
131129
:grpowned?,
132130
:identical?,

0 commit comments

Comments
 (0)