In Files

Parent

Methods

Class/Module Index [+]

Quicksearch

FlogTask

Attributes

dirs[RW]
name[RW]
threshold[RW]
verbose[RW]

Public Class Methods

new(name = :flog, threshold = 200, dirs = nil) click to toggle source
# 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

Public Instance Methods

define() click to toggle source
# 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.