Class: Glossarist::CLI::CompareCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/glossarist/cli/compare_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(new_path, old_path, options) ⇒ CompareCommand

Returns a new instance of CompareCommand.



8
9
10
11
12
# File 'lib/glossarist/cli/compare_command.rb', line 8

def initialize(new_path, old_path, options)
  @new_path = new_path
  @old_path = old_path
  @options = options
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/glossarist/cli/compare_command.rb', line 14

def run
  new_concepts = ConceptCollector.collect(@new_path)
  old_concepts = ConceptCollector.collect(@old_path)

  result = ConceptComparator.new(
    new_concepts: new_concepts,
    old_concepts: old_concepts,
  ).compare(show_diffs: !@options[:no_diffs])

  report(result)
end