In Files

Included Modules

Class/Module Index [+]

Quicksearch

RR

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_matching(pattern) click to toggle source
# File lib/rr/integrations.rb, line 33
def self.find_applicable_adapter_matching(pattern)
  adapter = adapters.
    select { |adapter| adapter.name.to_s =~ pattern }.
    find   { |adapter| adapter.applies? }
  if 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.hook
      end
    end
    mod
  end
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
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
ruby_18?() click to toggle source
# File lib/rr/without_autohook.rb, line 121
def ruby_18?
  RUBY_VERSION =~ /^1\.8/
end
version() click to toggle source
# File lib/rr/version.rb, line 4
def self.version; VERSION; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.