lib/rubycritic.rb in rubycritic-0.0.2 vs lib/rubycritic.rb in rubycritic-0.0.3
- old
+ new
@@ -6,22 +6,22 @@
require "rubycritic/report_generators/reporter"
module Rubycritic
class Rubycritic
- def initialize(dirs)
- @source = SourceLocator.new(dirs)
+ def initialize
@source_control_system = SourceControlSystem.create
end
- def critique
+ def critique(dirs)
+ source = SourceLocator.new(dirs)
if @source_control_system.has_revision?
- smelly_pathnames = RevisionComparator.new(@source.paths, @source_control_system).compare
+ smelly_pathnames = RevisionComparator.new(source.paths, @source_control_system).compare
else
- smell_adapters = AnalysersRunner.new(@source.paths).run
+ smell_adapters = AnalysersRunner.new(source.paths).run
smelly_pathnames = SmellsAggregator.new(smell_adapters).smelly_pathnames
end
- Reporter.new(@source.pathnames, smelly_pathnames).generate_report
+ Reporter.new(source.pathnames, smelly_pathnames).generate_report
end
end
end