lib/ddtrace/contrib/grape/integration.rb in ddtrace-0.33.0 vs lib/ddtrace/contrib/grape/integration.rb in ddtrace-0.33.1
- old
+ new
@@ -7,21 +7,24 @@
module Grape
# Description of Grape integration
class Integration
include Contrib::Integration
+ MINIMUM_VERSION = Gem::Version.new('1.0')
+
register_as :grape, auto_patch: true
def self.version
Gem.loaded_specs['grape'] && Gem.loaded_specs['grape'].version
end
def self.loaded?
- defined?(::Grape) && defined?(::ActiveSupport::Notifications)
+ !defined?(::Grape).nil? \
+ && !defined?(::ActiveSupport::Notifications).nil?
end
def self.compatible?
- super && version >= Gem::Version.new('1.0')
+ super && version >= MINIMUM_VERSION
end
def default_configuration
Configuration::Settings.new
end