Sha256: 08337d33851645214df2cad2dc64b96ac7788ca4b90221eef641c373a666662e

Contents?: true

Size: 854 Bytes

Versions: 4

Compression:

Stored size: 854 Bytes

Contents

require "rubycritic/source_locator"
require "rubycritic/analysers_runner"
require "rubycritic/smells_aggregator"
require "rubycritic/source_control_systems/source_control_system"
require "rubycritic/revision_comparator"
require "rubycritic/report_generators/reporter"

module Rubycritic

  class Rubycritic
    def initialize
      @source_control_system = SourceControlSystem.create
    end

    def critique(paths)
      source = SourceLocator.new(paths)
      if @source_control_system.has_revision?
        smelly_pathnames = RevisionComparator.new(source.paths, @source_control_system).compare
      else
        smell_adapters = AnalysersRunner.new(source.paths).run
        smelly_pathnames = SmellsAggregator.new(smell_adapters).smelly_pathnames
      end
      Reporter.new(source.pathnames, smelly_pathnames).generate_report
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubycritic-0.0.7 lib/rubycritic.rb
rubycritic-0.0.6 lib/rubycritic.rb
rubycritic-0.0.5 lib/rubycritic.rb
rubycritic-0.0.4 lib/rubycritic.rb