Module: Hoe::Flog
- Defined in:
- lib/hoe/flog.rb
Overview
Flog plugin for hoe.
Tasks Provided:
- flog
-
Analyze code complexity.
Instance Attribute Summary collapse
-
#flog_method ⇒ Object
Optional: flog method to run to determine threshold.
-
#flog_threshold ⇒ Object
Optional: flog threshold to determine threshold failure.
Instance Method Summary collapse
-
#define_flog_tasks ⇒ Object
Define tasks for plugin.
-
#initialize_flog ⇒ Object
Initialize variables for plugin.
Instance Attribute Details
#flog_method ⇒ Object
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 |
#flog_threshold ⇒ Object
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
#define_flog_tasks ⇒ Object
Define tasks for plugin.
30 31 32 33 34 35 |
# File 'lib/hoe/flog.rb', line 30 def define_flog_tasks require "flog_task" FlogTask.new :flog, self.flog_threshold, nil, self.flog_method rescue LoadError # skip end |
#initialize_flog ⇒ Object
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 |