From f01f97224ee1ee42905077894ccfae05a2a09307 Mon Sep 17 00:00:00 2001 From: Hannah Ramadan <76922290+hannahramadan@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:22:26 -0700 Subject: [PATCH] Update lib/new_relic/agent/instrumentation/grape.rb Co-authored-by: James Bunch --- lib/new_relic/agent/instrumentation/grape.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/new_relic/agent/instrumentation/grape.rb b/lib/new_relic/agent/instrumentation/grape.rb index fb92bad2a4..6a136c36bb 100644 --- a/lib/new_relic/agent/instrumentation/grape.rb +++ b/lib/new_relic/agent/instrumentation/grape.rb @@ -19,16 +19,10 @@ depends_on do begin - if defined?(Bundler) - grape_present = (Bundler::VERSION >= '2' && Bundler.rubygems.installed_specs.map(&:name).include?('newrelic-grape')) || - Bundler.rubygems.all_specs.map(&:name).include?('newrelic-grape') - - if grape_present - NewRelic::Agent.logger.info('Not installing New Relic supported Grape instrumentation because the third party newrelic-grape gem is present') - false - else - true - end + if (defined?(Bundler) && (Bundler::VERSION >= '2' && Bundler.rubygems.installed_specs.map(&:name).include?('newrelic-grape')) || + Bundler.rubygems.all_specs.map(&:name).include?('newrelic-grape')) + NewRelic::Agent.logger.info('Not installing New Relic supported Grape instrumentation because the third party newrelic-grape gem is present') + false else true end