Class: RubyCritic::RevisionComparator

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/revision_comparator.rb

Constant Summary collapse

SNAPSHOTS_DIR_NAME =
'snapshots'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ RevisionComparator

Returns a new instance of RevisionComparator.


13
14
15
# File 'lib/rubycritic/revision_comparator.rb', line 13

def initialize(paths)
  @paths = paths
end

Instance Method Details

#statuses=(analysed_modules_now) ⇒ Object


17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rubycritic/revision_comparator.rb', line 17

def statuses=(analysed_modules_now)
  return unless Config.source_control_system.revision?

  analysed_modules_before = load_cached_analysed_modules
  return unless analysed_modules_before

  SmellsStatusSetter.set(
    analysed_modules_before.flat_map(&:smells),
    analysed_modules_now.flat_map(&:smells)
  )
end