Class: Rodiff::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/rodiff/cli.rb', line 39

def self.exit_on_failure?
  true
end

Instance Method Details

#compare(baseline = nil, variant = nil, diff = nil) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/rodiff/cli.rb', line 30

def compare(baseline = nil, variant = nil, diff = nil)
  all_present, all_absent = args_presence(baseline, variant, diff)
  raise ArgumentError, "BASELINE, VARIANT, DIFF must be provided" unless all_present ^ all_absent

  odiff_exec(baseline, variant, diff)
rescue Rodiff::Error => e
  raise Thor::Error, "ERROR: #{e.message}"
end

#versionObject



20
21
22
23
24
25
26
# File 'lib/rodiff/cli.rb', line 20

def version
  if options.odiff?
    odiff_exec("--version")
  else
    say Rodiff::VERSION
  end
end