Class: DontRepeatYourself::RubyProjectReporter

Inherits:
ProjectReporterBase show all
Defined in:
lib/dont_repeat_yourself/reporter.rb

Overview

TODO Rename to RubyGemProjectReporter. we might add a “java” project reporter at some point 1 day ;-)

Direct Known Subclasses

RailsProjectReporter

Instance Attribute Summary

Attributes inherited from ProjectReporterBase

#maximum_number_of_duplicate_lines_i_want_in_my_project, #name, #report_type

Instance Method Summary collapse

Methods inherited from ProjectReporterBase

#basedir, build_reporter, #description, #failure_message, #ignoring_the_directory, #ignoring_the_file, #is_dry?, #patterns_of_directories_to_search_for_duplicate_lines, #report, #with_threshold_of_duplicate_lines

Constructor Details

#initialize(project_path) ⇒ RubyProjectReporter

Returns a new instance of RubyProjectReporter.



111
112
113
114
# File 'lib/dont_repeat_yourself/reporter.rb', line 111

def initialize(project_path)
  super(basename_of_directory(project_path))
  @simian_runner.basedir = project_path      
end

Instance Method Details

#configure_simianObject



116
117
118
119
120
121
# File 'lib/dont_repeat_yourself/reporter.rb', line 116

def configure_simian        
  # Only add the "lib" directoy if exists
  @simian_runner.add_ruby_directory_to_search_for_duplicate_lines("lib")
  @simian_runner.add_ruby_directory_to_search_for_duplicate_lines("test") if folder_exists?("test")
  @simian_runner.add_ruby_directory_to_search_for_duplicate_lines("spec") if folder_exists?("spec")
end