Skip to content

Remove deprecated methods #3432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ Compatibility:
* Do not autosplat a proc that accepts a single positional argument and keywords (#3039, @andrykonchin).
* Support passing anonymous * and ** parameters as method call arguments (#3039, @andrykonchin).
* Handle either positional or keywords arguments by default in `Struct.new` (#3039, @rwstauner).
* Remove deprecated methods `Dir.exists?`, `File.exists?`, and `Kernel#=~` (#3039, @patricklinpl, @nirvdrum).

Performance:

4 changes: 0 additions & 4 deletions lib/truffle/pathname.rb
Original file line number Diff line number Diff line change
@@ -1084,10 +1084,6 @@ def unlink()
alias delete unlink
end

class Pathname
undef =~
end

module Kernel
# create a pathname object.
#
1 change: 0 additions & 1 deletion spec/tags/core/dir/exist_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/file/exist_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/kernel/match_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/main/ruby/truffleruby/core/dir.rb
Original file line number Diff line number Diff line change
@@ -206,7 +206,6 @@ def empty?(path)
def exist?(path)
PrivateFile.directory?(path)
end
alias_method :exists?, :exist?

def home(user = nil)
user = StringValue(user) unless Primitive.nil?(user)
1 change: 0 additions & 1 deletion src/main/ruby/truffleruby/core/file.rb
Original file line number Diff line number Diff line change
@@ -1149,7 +1149,6 @@ def self.sticky?(path)
class << self
alias_method :delete, :unlink
alias_method :empty?, :zero?
alias_method :exists?, :exist?
alias_method :fnmatch?, :fnmatch
end

7 changes: 1 addition & 6 deletions src/main/ruby/truffleruby/core/kernel.rb
Original file line number Diff line number Diff line change
@@ -181,13 +181,8 @@ def `(str) #`
end
module_function :` # `

def =~(other)
warn "deprecated Object#=~ is called on #{Primitive.class(self)}; it always returns nil", uplevel: 1 if $VERBOSE
nil
end

def !~(other)
r = self =~ other ? false : true
r = self.respond_to?(:=~) ? !(self =~ other) : true
Primitive.regexp_last_match_set(Primitive.caller_special_variables, $~)
r
end