# File lib/flog_task.rb, line 7 def initialize name = :flog, threshold = 200, dirs = nil @name = name @dirs = dirs || %(app bin lib spec test) @threshold = threshold @verbose = Rake.application.options.trace yield self if block_given? @dirs.reject! { |f| ! File.directory? f } define end
# File lib/flog_task.rb, line 20 def define desc "Analyze for code complexity in: #{dirs.join(', ')}" task name do flog = Flog.new flog.flog_files(*dirs) flog.report if verbose raise "Flog total too high! #{flog.total} > #{threshold}" if flog.total > threshold end self end
Generated with the Darkfish Rdoc Generator 2.