Sha256: 31d4b52da4c8578d0ce03678227d9990da7db0ec58645cb65a01352c3d347738

Contents?: true

Size: 874 Bytes

Versions: 20

Compression:

Stored size: 874 Bytes

Contents

require "yaml"

begin
  require "appsignal_extension"
  Appsignal.extension_loaded = true
rescue LoadError => err
  Appsignal.logger.error(
    "Failed to load extension (#{err}), please check the install.log file in " \
    "the ext directory of the gem and e-mail us at support@appsignal.com"
  )
  Appsignal.extension_loaded = false
end

module Appsignal
  # @api private
  class Extension
    class << self
      def agent_config
        @agent_config ||= YAML.load(
          File.read(File.join(File.dirname(__FILE__), "../../ext/agent.yml"))
        )
      end

      def agent_version
        agent_config["version"]
      end

      def method_missing(m, *args, &block)
        # Do nothing if the extension methods are not loaded
      end
    end

    class Data
      def inspect
        "#<#{self.class.name}:#{object_id} #{self}>"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
appsignal-2.4.3 lib/appsignal/extension.rb
appsignal-2.4.2 lib/appsignal/extension.rb
appsignal-2.4.1 lib/appsignal/extension.rb
appsignal-2.4.0 lib/appsignal/extension.rb
appsignal-2.4.0.alpha.1 lib/appsignal/extension.rb
appsignal-2.3.7 lib/appsignal/extension.rb
appsignal-2.3.6 lib/appsignal/extension.rb
appsignal-2.3.6.beta.1 lib/appsignal/extension.rb
appsignal-2.3.4 lib/appsignal/extension.rb
appsignal-2.3.3 lib/appsignal/extension.rb
appsignal-2.3.3.beta.1 lib/appsignal/extension.rb
appsignal-2.3.2 lib/appsignal/extension.rb
appsignal-2.3.1 lib/appsignal/extension.rb
appsignal-2.3.0 lib/appsignal/extension.rb
appsignal-2.3.0.beta.3 lib/appsignal/extension.rb
appsignal-2.3.0.beta.2 lib/appsignal/extension.rb
appsignal-2.3.0.beta.1 lib/appsignal/extension.rb
appsignal-2.2.1 lib/appsignal/extension.rb
appsignal-2.2.0 lib/appsignal/extension.rb
appsignal-2.2.0.beta.1 lib/appsignal/extension.rb