Class: Ea::Cli::Command::Diff

Inherits:
Base
  • Object
show all
Defined in:
lib/ea/cli/command/diff.rb

Overview

ea diff OLD_FILE NEW_FILE

Standalone — does not require lutaml-uml. Loads two QEA databases and reports added / removed / renamed entities.

Exit code: 0 if identical, 1 if any differences found.

Constant Summary collapse

COLUMNS =
%i[change kind id name].freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Ea::Cli::Command::Base

Instance Method Details

#callObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ea/cli/command/diff.rb', line 15

def call
  if options[:format] == "html"
    write_html_report
  else
    rows = comparator.differences.map do |diff|
      [diff.change, diff.kind, diff.id, diff.name]
    end
    formatter.render(rows, columns: COLUMNS)
  end
  exit(1) if comparator.differences.any?
end