Sha256: 44d93e26d98bb85af98425bbd54daa228fcacb7c537fac1789fc9c62b29639be
Contents?: true
Size: 1.19 KB
Versions: 39
Compression:
Stored size: 1.19 KB
Contents
# encoding: utf-8 module OneApm class Probe module FrameworkLoader def init(options = {}) instance.init_plugin options end def instance @instance ||= new_instance end def new_instance if OneApm::Manager.config[:framework] == :test load_test_framework else load_framework_class(Manager.config[:framework]).new(local_env) end end def reset @instance = nil @local_env = nil end def local_env @local_env ||= OneApm::LocalEnvironment.new end def load_test_framework config = File.expand_path(File.join('..', '..', '..', '..', 'test', 'config', 'oneapm.yml'), __FILE__) require 'config/test_control' OneApm::Probe::Frameworks::Test.new(local_env, config) end def load_framework_class(framework) begin require "one_apm/frameworks/#{framework}" rescue LoadError end OneApm::Probe::Frameworks.const_get(framework.to_s.capitalize) end def oneapm_root File.expand_path(File.join('..', '..', '..', '..'), __FILE__) end end extend FrameworkLoader end end
Version data entries
39 entries across 39 versions & 1 rubygems