1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
##
# Flog plugin for hoe.
#
# === Tasks Provided:
#
# flog:: Analyze code complexity.
module Hoe::Flog
##
# Optional: flog threshold to determine threshold failure. [default: 1500-200]
attr_accessor :flog_threshold
##
# Initialize variables for plugin.
def initialize_flog
self.flog_threshold ||= timebomb 1500, 1000 # 80% of average :(
end
##
# Define tasks for plugin.
def define_flog_tasks
begin
require 'flog_task'
FlogTask.new :flog, self.flog_threshold
rescue Exception
# skip
end
end
end
|