Sha256: 0b5e5afe95bf06c1f1b9581142a3b3d34ec5972d629673b8a5ecc5d9e9b33604

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'rake/instrumentation'
require_relative 'rake/chain'
require_relative 'rake/prepend'

DependencyDetection.defer do
  # Why not :rake? newrelic-rake used that name, so avoid conflicting
  @name = :rake_instrumentation
  configure_with :rake

  depends_on { defined?(Rake) && defined?(Rake::VERSION) }
  depends_on { Gem::Version.new(Rake::VERSION) >= Gem::Version.new('10.0.0') }
  depends_on { NewRelic::Agent.config[:'rake.tasks'].any? }
  depends_on { NewRelic::Agent::Instrumentation::Rake.safe_from_third_party_gem? }

  executes do
    NewRelic::Agent.logger.info('Installing Rake instrumentation')
    NewRelic::Agent.logger.debug("Instrumenting Rake tasks: #{NewRelic::Agent.config[:'rake.tasks']}")
  end

  executes do
    if use_prepend?
      prepend_instrument Rake::Task, NewRelic::Agent::Instrumentation::Rake::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::Rake::Chain
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.5.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.4.2 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.4.1 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.4.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.3.1 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.3.0 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.2.2 lib/new_relic/agent/instrumentation/rake.rb
newrelic_rpm-9.2.1 lib/new_relic/agent/instrumentation/rake.rb