Remove Ruby 2.0-specific code paths#1503
Conversation
ivoanjo
left a comment
There was a problem hiding this comment.
LGTM! Big thanks for doing this :)
/me looks at 2.1: you're next!
| module Datadog | ||
| # Namespace for ddtrace OpenTracing implementation | ||
| module OpenTracer |
There was a problem hiding this comment.
Just to confirm: This file assumes that opentracing is available when it gets required. Is that because it never gets required automatically, e.g. it's up to customers to add require 'ddtrace/opentracer'?
There was a problem hiding this comment.
That's right! We never eagerly load lib/ddtrace/opentracer.rb: https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#quickstart-for-opentracing
| def self.ruby_engine_unsupported? | ||
| 'JRuby is not supported' if RUBY_ENGINE == 'jruby' | ||
| end | ||
| private_class_method :ruby_engine_unsupported? |
There was a problem hiding this comment.
Minor: I'll do a few post-2.0 cleanups as well, but we can finally use do private_class_method def ... and avoid having to retype the method name afterwards! :) :) :)
This PR removes code paths that only existed to handle Ruby 2.0 execution.
The two main non-trivial changes are:
OpenTracerrequires Ruby 2.1+, thus support for it is now unconditional.Some nested conditional paths have been removed, thus I recommend reviewing this PR with "Hide whitespace changes": https://github.com/DataDog/dd-trace-rb/pull/1503/files&w=1.
This PR does not update existing code paths to use
2.1+-only features: that work will be performed in a separate PR.Ruby 2.0 deprecation checklist