# File lib/flay_task.rb, line 7 def initialize name = :flay, 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/flay_task.rb, line 20 def define desc "Analyze for code duplication in: #{dirs.join(', ')}" task name do flay = Flay.new flay.process(*Flay.expand_dirs_to_files(dirs)) flay.report if verbose raise "Flay total too high! #{flay.total} > #{threshold}" if flay.total > threshold end self end
Generated with the Darkfish Rdoc Generator 2.