From 258198db5123c8622ceeca68a30f103c3abc7e55 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Fri, 1 Apr 2022 09:59:00 -0500 Subject: [PATCH] docs: Update description of compatible method Co-authored-by: Robb Kidd --- .../base/lib/opentelemetry/instrumentation/base.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/instrumentation/base/lib/opentelemetry/instrumentation/base.rb b/instrumentation/base/lib/opentelemetry/instrumentation/base.rb index 0fdee7356..efc889974 100644 --- a/instrumentation/base/lib/opentelemetry/instrumentation/base.rb +++ b/instrumentation/base/lib/opentelemetry/instrumentation/base.rb @@ -31,6 +31,11 @@ module Instrumentation # end # # # if the target library is present, is it compatible? + # # Common ways to retrieve a gem's version for comparison: + # # - ::Gemname::VERSION if the gem declares a version constant + # # - ::Gemname.version if the gem has provided a version method on the gem class + # # If a VERSION constant or version method are not available, as a fallback you can: + # # - Gem.loaded_specs.fetch('gemname').version - attempt to retrieve the gemspec from the gems currently loaded and use its version # compatible do # Gem::Version.new(Sinatra::VERSION)) > MIN_VERSION # end