lib/rubycritic/commands/default.rb in rubycritic-1.2.1 vs lib/rubycritic/commands/default.rb in rubycritic-1.3.0
- old
+ new
@@ -4,26 +4,25 @@
require "rubycritic/reporters/main"
module Rubycritic
module Command
class Default
- def initialize(options)
- @paths = options[:paths]
+ def initialize(paths)
+ @paths = paths
Config.source_control_system = SourceControlSystem::Base.create
end
def execute
- critique(@paths)
- report
+ report(critique)
end
- def critique(paths)
- @analysed_modules = AnalysersRunner.new(paths).run
- RevisionComparator.new(paths).set_statuses(@analysed_modules)
+ def critique
+ analysed_modules = AnalysersRunner.new(@paths).run
+ RevisionComparator.new(@paths).set_statuses(analysed_modules)
end
- def report
- report_location = Reporter::Main.new(@analysed_modules).generate_report
+ def report(analysed_modules)
+ report_location = Reporter::Main.new(analysed_modules).generate_report
puts "New critique at #{report_location}"
end
end
end
end