Module: Sevgi::Binaries::Igves

Extended by:
Igves
Included in:
Igves
Defined in:
lib/sevgi/binaries/igves.rb

Overview

Implements the igves executable that converts SVG files into Sevgi DSL source.

Constant Summary collapse

PROGNAME =

Executable name used in help output.

"igves"
Error =

Error raised for invalid command-line usage.

Class.new(::Sevgi::Error)

Instance Method Summary collapse

Instance Method Details

#call(argv) ⇒ nil

Runs the igves command-line interface.

Parameters:

  • argv (Array<String>, String, nil)

    command-line arguments

Returns:

  • (nil)

Raises:

  • (Sevgi::ArgumentError)

    when the SVG file cannot be found

  • (Sevgi::PanicError)

    when generated Ruby source cannot be formatted

  • (StandardError)

    when --exception or SEVGI_VOMIT requests raw errors

  • (SystemExit)

    when command-line usage aborts



57
58
59
60
61
# File 'lib/sevgi/binaries/igves.rb', line 57

def call(argv)
  dispatch(Array(argv))
rescue Binaries::Igves::Error => e
  abort(e.message)
end