Class: Lutaml::Model::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/lutaml/model/cli.rb

Instance Method Summary collapse

Instance Method Details

#compare(path1, path2) ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
23
24
25
26
27
28
29
30
# File 'lib/lutaml/model/cli.rb', line 20

def compare(path1, path2)
  raise ArgumentError, "File not found: #{path1}" unless File.file?(path1)
  raise ArgumentError, "File not found: #{path2}" unless File.file?(path2)

  validate_compare_options!(options)

  require File.expand_path(options[:model_file])
  model_class = constantize_model!(options[:root_class])

  compare_files!(path1, path2, model_class)
end