Class: SvgConform::Cli

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

Overview

Thor-based CLI for SvgConform with svgcheck-like functionality

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cli

Returns a new instance of Cli.



14
15
16
# File 'lib/svg_conform/cli.rb', line 14

def initialize(*args)
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args) ⇒ Object (private)



100
101
102
103
104
105
# File 'lib/svg_conform/cli.rb', line 100

def method_missing(method_name, *_args)
  puts Paint["Unknown command: #{method_name}", :red]
  puts
  help
  exit 1
end

Instance Method Details

#check(*files) ⇒ Object



74
75
76
# File 'lib/svg_conform/cli.rb', line 74

def check(*files)
  SvgConform::Commands::Check.new(files, options).execute
end

#profilesObject



89
90
91
# File 'lib/svg_conform/cli.rb', line 89

def profiles
  SvgConform::Commands::Profiles.new(options).execute
end

#versionObject



94
95
96
# File 'lib/svg_conform/cli.rb', line 94

def version
  puts "SvgConform #{SvgConform::VERSION}"
end