Skip to content

Commit

Permalink
Why so complex
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahramadan committed Aug 21, 2024
1 parent 8c954c1 commit b33eac4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/new_relic/agent/instrumentation/grape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

depends_on do
begin
if defined?(Bundler) && ((Bundler::VERSION >= '2' && Bundler.rubygems.installed_specs.map(&:name).include?('newrelic-grape')) ||
Bundler.rubygems.all_specs.map(&:name).include?('newrelic-grape'))
return unless defined?(Bundler)

if Gem::Version.new(Bundler::VERSION) >= Gem::Version.new('2.0.0') && 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
Expand Down

0 comments on commit b33eac4

Please sign in to comment.