Module: Datadog::RubyVersion
- Extended by:
- RubyVersion
- Defined in:
- lib/datadog/ruby_version.rb
Overview
Compares the running Ruby against version requirements.
Lexical comparisons against RUBY_VERSION are subtly wrong: RUBY_VERSION < "3.2.3" is also
true on 3.2.10 and 3.2.11, since those sort before "3.2.3" as strings.
Instance Method Summary collapse
-
#is?(*requirements, ruby_version: CURRENT_RUBY_VERSION) ⇒ Boolean
Returns
truewhen the running Ruby satisfies ALL of the given requirements.
Instance Method Details
#is?(*requirements, ruby_version: CURRENT_RUBY_VERSION) ⇒ Boolean
Returns true when the running Ruby satisfies ALL of the given requirements. Each uses the
same syntax as a gem dependency (e.g. ">= 3.1", ">= 3.2", "< 3.2.3").
21 22 23 |
# File 'lib/datadog/ruby_version.rb', line 21 def is?(*requirements, ruby_version: CURRENT_RUBY_VERSION) Gem::Requirement.new(*requirements).satisfied_by?(ruby_version) end |