module OneApm::Probe::FrameworkLoader

Public Instance Methods

init(options = {}) click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 7
def init(options = {})
  instance.init_plugin options
end
instance() click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 11
def instance
  @instance ||= new_instance
end
load_framework_class(framework) click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 38
def load_framework_class(framework)
  begin
    require "one_apm/frameworks/#{framework}"
  rescue LoadError
  end
  OneApm::Probe::Frameworks.const_get(framework.to_s.capitalize)
end
load_test_framework() click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 32
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
local_env() click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 28
def local_env
  @local_env ||= OneApm::LocalEnvironment.new
end
new_instance() click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 15
def new_instance
  if OneApm::Manager.config[:framework] == :test
    load_test_framework
  else
    load_framework_class(Manager.config[:framework]).new(local_env)
  end
end
oneapm_root() click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 46
def oneapm_root
  File.expand_path(File.join('..', '..', '..', '..'), __FILE__)
end
reset() click to toggle source
# File lib/one_apm/probe/framework_loader.rb, line 23
def reset
  @instance = nil
  @local_env = nil
end