module RR

Constants

ProcFromBlock
VERSION

Attributes

debug[RW]
debug?[RW]
overridden_error_class[RW]

Public Class Methods

adapters() click to toggle source
# File lib/rr/integrations.rb, line 15
def self.adapters
  @adapters ||= []
end
adapters_by_name() click to toggle source
# File lib/rr/integrations.rb, line 19
def self.adapters_by_name
  @adapters_by_name ||= {}
end
applicable_adapters() click to toggle source
# File lib/rr/integrations.rb, line 29
def self.applicable_adapters
  adapters.select { |adapter| adapter.applies? }
end
autohook() click to toggle source
# File lib/rr/autohook.rb, line 3
def autohook
  applicable_adapters.each { |adapter| adapter.load }
  if applicable_adapters.empty?
    puts "No adapters matched!" if RR.debug?
  end
end
find_applicable_adapter(name) click to toggle source
# File lib/rr/integrations.rb, line 33
def self.find_applicable_adapter(name)
  adapters.
    select { |adapter| name === adapter.name.to_s }.
    find   { |adapter| adapter.applies? }
end
loaded_adapter_names() click to toggle source
# File lib/rr/integrations.rb, line 23
def self.loaded_adapter_names
  adapters.
    select { |adapter| adapter.loaded? }.
    map { |adapter| adapter.name }
end
module_shim_for_adapter(adapter) click to toggle source
# File lib/rr/integrations.rb, line 39
def self.module_shim_for_adapter(adapter)
  mod = Module.new
  (class << mod; self; end).class_eval do
    define_method(:included) do |base|
      # Note: This assumes that the thing that is including this module
      # is the same that the adapter detected and will hook into.
      adapter.load
    end
  end
  mod
end
register_adapter(klass) click to toggle source
# File lib/rr/integrations.rb, line 7
def self.register_adapter(klass)
  adapter = Integrations::Decorator.new(klass.new)
  unless adapters_by_name.key?(adapter.name)
    adapters << adapter
    adapters_by_name[adapter.name] = adapter
  end
end
version() click to toggle source
# File lib/rr/version.rb, line 3
def self.version; VERSION; end