lib/quality/rake/task.rb in quality-0.2.9 vs lib/quality/rake/task.rb in quality-0.2.10

- old
+ new

@@ -36,10 +36,15 @@ # Array of strings describing tools to be skipped--e.g., ["cane"] # # Defaults to [] attr_accessor :skip_tools + # Array of directory names which contain ruby files to analyze. + # + # Defaults to %w{lib test features}, which translates to *.rb in the base directory, as well as lib, test, and features. + attr_writer :ruby_dirs + # Defines a new task, using the name +name+. def initialize(args = {}) @name = args[:name] @name = 'quality' if @name.nil? @skip_tools = [] if @skip_tools.nil? @@ -157,11 +162,15 @@ 0 end } end + def ruby_dirs + @ruby_dirs ||= %w{lib test features} + end + def ruby_files - Dir.glob('*.rb').concat(Dir.glob(File.join('{lib,test}', '**', '*.rb'))).join(' ') + Dir.glob('*.rb').concat(Dir.glob(File.join("{#{ruby_dirs.join(',')}}", '**', '*.rb'))).join(' ') end def quality_reek args = "--line-number #{ruby_files}" ratchet_quality_cmd("reek",