Sha256: 8e7433be0ea6195cc4a8a0ce887724c9bd5a212f96c40f55575ad8ee766a3521

Contents?: true

Size: 741 Bytes

Versions: 12

Compression:

Stored size: 741 Bytes

Contents

# typed: false

require_relative '../analytics'

module Datadog
  module Tracing
    module Contrib
      module Rails
        # common utilities for Rails
        module Utils
          def self.app_name
            if ::Rails::VERSION::MAJOR >= 6
              ::Rails.application.class.module_parent_name.underscore
            elsif ::Rails::VERSION::MAJOR >= 4
              ::Rails.application.class.parent_name.underscore
            else
              ::Rails.application.class.to_s.underscore
            end
          end

          def self.railtie_supported?
            !(defined?(::Rails::VERSION::MAJOR) && ::Rails::VERSION::MAJOR >= 3 && defined?(::Rails::Railtie)).nil?
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.8.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.7.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.6.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.6.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.5.2 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.5.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.5.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.4.2 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.4.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.4.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.3.0 lib/datadog/tracing/contrib/rails/utils.rb