Skip to content
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

Remove deprecated methods #3432

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

patricklinpl
Copy link
Contributor

@patricklinpl patricklinpl commented Feb 1, 2024

Part of #3039

Remove deprecated methods:

  • Dir.exists?
  • File.exists?
  • Kernel#=~

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 1, 2024
@patricklinpl patricklinpl force-pushed the hackday/remove-deprecated-methods branch from f1fdda7 to 02c829c Compare February 1, 2024 22:44
@patricklinpl patricklinpl force-pushed the hackday/remove-deprecated-methods branch from 02c829c to 69b3236 Compare February 1, 2024 22:45
@patricklinpl patricklinpl changed the title Hackday/remove deprecated methods Remove deprecated methods Feb 1, 2024
Comment on lines 190 to 185
r = self =~ other ? false : true
r = nil ? false : true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought using nil here would make sense since =~ returns nil; would it be better to just return true?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=~ returned nil as the default implementation. But, if a class defines =~ then !~ will call that version. You can see the dynamic call in CRuby:

https://github.com/ruby/ruby/blob/7b93e65e9f9cb7abfc7e19aff4da9d6e4c32de4b/object.c#L1629-L1634

As an example:

class X
  def =~(other)
    puts :hi
  end
end

X.new !~ "abc"

That will print out 'hi' because !~ delegates to =~.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh i see thanks; i used respond_to to check for an implantation, is there a better approach?

@patricklinpl patricklinpl force-pushed the hackday/remove-deprecated-methods branch from 69b3236 to 764f883 Compare February 2, 2024 04:08
@patricklinpl patricklinpl requested a review from nirvdrum February 2, 2024 04:16
@patricklinpl patricklinpl marked this pull request as ready for review February 2, 2024 04:16
@patricklinpl patricklinpl marked this pull request as draft February 2, 2024 04:25
Co-authored-by: Kevin Menard <kevin.menard@shopify.com>
@patricklinpl patricklinpl marked this pull request as ready for review February 2, 2024 22:46
@eregon
Copy link
Member

eregon commented Feb 5, 2024

@andrykonchin already has a PR for this in #3444, he will try to rebase his PR on top of this one.

@andrykonchin andrykonchin added the in-ci The PR is being tested in CI. Do not push new commits. label Feb 6, 2024
@graalvmbot graalvmbot merged commit 18bb410 into oracle:master Feb 13, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-ci The PR is being tested in CI. Do not push new commits. OCA Verified All contributors have signed the Oracle Contributor Agreement. shopify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants