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

Use public prepend, include, and extend methods #1509

Merged
merged 1 commit into from
May 20, 2021

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented May 19, 2021

This uses the public version of Module#prepend and Module#include.

#prepend and #include were private in 2.0.

Also, this PR cleans up usages of Object#extend that used the send(:extend) syntax, instead of #extend. This method was public in Ruby 2.0, but we were likely conservative with its call syntax due to its apparent proximity to the non-public #prepend and #include.

Ruby 2.0 deprecation checklist

  • Remove 2.0 from CI
  • Remove 2.0-specific code paths
  • Update to 2.1+ standards: https://github.com/ruby/ruby/blob/v2_1_0/NEWS
    • Module#include and Module#prepend are now public methods.
    • Exception#cause
    • Array#to_h converts an array of key-value pairs into a Hash.
    • Kernel#singleton_method
    • Process.clock_gettime
    • Enumerable#to_h converts a list of key-value pairs into a Hash.
    • Now the default values of keyword arguments can be omitted. Those “required keyword arguments” need giving explicitly at the call time.
  • Update documentation

@marcotc marcotc added the deprecation Involves a deprecation label May 19, 2021
@marcotc marcotc self-assigned this May 19, 2021
@marcotc marcotc requested a review from a team May 19, 2021 19:21
@codecov-commenter
Copy link

Codecov Report

Merging #1509 (f9245ef) into master (88d321b) will not change coverage.
The diff coverage is 98.42%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1509   +/-   ##
=======================================
  Coverage   98.22%   98.22%           
=======================================
  Files         862      862           
  Lines       41686    41686           
=======================================
  Hits        40945    40945           
  Misses        741      741           
Impacted Files Coverage Δ
lib/ddtrace/contrib/faraday/patcher.rb 92.30% <50.00%> (ø)
spec/ddtrace/profiling/ext/cthread_spec.rb 90.00% <85.71%> (ø)
lib/ddtrace/configuration/base.rb 97.67% <100.00%> (ø)
lib/ddtrace/configuration/options.rb 100.00% <100.00%> (ø)
lib/ddtrace/contrib/action_cable/event.rb 100.00% <100.00%> (ø)
...e/contrib/action_pack/action_controller/patcher.rb 100.00% <100.00%> (ø)
lib/ddtrace/contrib/action_view/event.rb 100.00% <100.00%> (ø)
lib/ddtrace/contrib/action_view/patcher.rb 96.29% <100.00%> (ø)
.../ddtrace/contrib/active_model_serializers/event.rb 100.00% <100.00%> (ø)
lib/ddtrace/contrib/active_record/event.rb 100.00% <100.00%> (ø)
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88d321b...f9245ef. Read the comment docs.

@marcotc marcotc merged commit b55af8a into master May 20, 2021
@marcotc marcotc deleted the deprecate-ruby-2.0-public-send branch May 20, 2021 17:51
@github-actions github-actions bot added this to the 0.50.0 milestone May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Involves a deprecation
Projects
Active work
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants