Skip to content

Commit

Permalink
Update lib/new_relic/agent/instrumentation/grape.rb
Browse files Browse the repository at this point in the history
Co-authored-by: James Bunch <fallwith@gmail.com>
  • Loading branch information
hannahramadan and fallwith authored Aug 20, 2024
1 parent 1e9c039 commit f01f972
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/new_relic/agent/instrumentation/grape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f01f972

Please sign in to comment.