Parent

Methods

RoodiTask

Attributes

config[RW]
name[RW]
patterns[RW]
verbose[RW]

Public Class Methods

new(name = :roodi, patterns = nil, config = nil) click to toggle source
# File lib/roodi_task.rb, line 7
def initialize name = :roodi, patterns = nil, config = nil
  @name      = name
  @patterns  = patterns || %(app/**/*.rb lib/**/*.rb spec/**/*.rb test/**/*.rb)
  @config    = config
  @verbose   = Rake.application.options.trace

  yield self if block_given?

  define
end

Public Instance Methods

define() click to toggle source
# File lib/roodi_task.rb, line 18
def define
  desc "Check for design issues in: #{patterns.join(', ')}"
  task name do
    runner = Roodi::Core::Runner.new

    runner.config = config if config

    patterns.each do |pattern|
      Dir.glob(pattern).each { |file| runner.check_file(file) }
    end

    runner.errors.each {|error| puts error}

    raise "Found #{runner.errors.size} errors." unless runner.errors.empty?
  end
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.