class Svgeez::Command
Public Class Methods
inherited(base)
click to toggle source
Calls superclass method
# File lib/svgeez/command.rb, line 8 def inherited(base) subclasses << base super(base) end
init_with_program(program)
click to toggle source
# File lib/svgeez/command.rb, line 13 def init_with_program(program) program.command(name.split('::').last.downcase.to_sym) do |command| command.description command_description command.syntax command_syntax add_actions(command) add_options(command) end end
subclasses()
click to toggle source
# File lib/svgeez/command.rb, line 4 def subclasses @subclasses ||= [] end
Private Class Methods
add_actions(command)
click to toggle source
# File lib/svgeez/command.rb, line 25 def add_actions(command) command.action do |_, options| command_action(options) end end
add_options(command)
click to toggle source
# File lib/svgeez/command.rb, line 31 def add_options(command) command.option 'source', '-s', '--source [FOLDER]', 'Source folder (defaults to ./_svgeez)' command.option 'destination', '-d', '--destination [OUTPUT]', 'Destination file or folder (defaults to ./svgeez.svg)' command.option 'prefix', '-p', '--prefix [PREFIX]', 'Custom Prefix for icon id (defaults to destination filename)' command.option 'svgo', '--with-svgo', 'Optimize source SVGs with SVGO before sprite generation (non-destructive)' end