Module: Hoe::Flog

Defined in:
lib/hoe/flog.rb

Overview

Flog plugin for hoe.

Tasks Provided:

flog

Analyze code complexity.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) flog_method

Optional: flog method to run to determine threshold. [default: :max_method]



17
18
19
# File 'lib/hoe/flog.rb', line 17

def flog_method
  @flog_method
end

- (Object) flog_threshold

Optional: flog threshold to determine threshold failure. [default: 1500-200]



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

def flog_threshold
  @flog_threshold
end

Instance Method Details

- (Object) define_flog_tasks

Define tasks for plugin.



30
31
32
33
34
35
36
37
# File 'lib/hoe/flog.rb', line 30

def define_flog_tasks
  begin
    require 'flog_task'
    FlogTask.new :flog, self.flog_threshold, nil, self.flog_method
  rescue LoadError
    # skip
  end
end

- (Object) initialize_flog

Initialize variables for plugin.



22
23
24
25
# File 'lib/hoe/flog.rb', line 22

def initialize_flog
  self.flog_method    ||= :max_method
  self.flog_threshold ||= 20 # 2x industry avg
end