Module: DeadCodeDetector

Defined in:
lib/dead_code_detector.rb,
lib/dead_code_detector/report.rb,
lib/dead_code_detector/storage.rb,
lib/dead_code_detector/version.rb,
lib/dead_code_detector/initializer.rb,
lib/dead_code_detector/configuration.rb,
lib/dead_code_detector/base_method_wrapper.rb,
lib/dead_code_detector/class_method_wrapper.rb,
lib/dead_code_detector/storage/redis_backend.rb,
lib/dead_code_detector/storage/memory_backend.rb,
lib/dead_code_detector/instance_method_wrapper.rb

Defined Under Namespace

Classes: BaseMethodWrapper, ClassMethodWrapper, Configuration, Initializer, InstanceMethodWrapper, Report, Storage

Constant Summary collapse

VERSION =
"0.0.12"

Class Method Summary collapse

Class Method Details

.configObject



16
17
18
# File 'lib/dead_code_detector.rb', line 16

def self.config
  @config ||= DeadCodeDetector::Configuration.new
end

.configure(&block) ⇒ Object



12
13
14
# File 'lib/dead_code_detector.rb', line 12

def self.configure(&block)
  block.call(config)
end

.enable(&block) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/dead_code_detector.rb', line 20

def self.enable(&block)
  begin
    DeadCodeDetector::Initializer.enable_for_cached_classes!
    block.call
  ensure
    config.storage.flush
  end
end