Class: SvgConform::Commands::Check
- Inherits:
-
Object
- Object
- SvgConform::Commands::Check
- Defined in:
- lib/svg_conform/commands/check.rb
Overview
Check command for validating SVG files (single or batch)
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(files, options) ⇒ Check
constructor
A new instance of Check.
Constructor Details
#initialize(files, options) ⇒ Check
Returns a new instance of Check.
12 13 14 15 |
# File 'lib/svg_conform/commands/check.rb', line 12 def initialize(files, ) @files = Array(files) @options = end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/svg_conform/commands/check.rb', line 17 def execute # Determine which files to process files_to_process = determine_files if files_to_process.empty? puts Paint["Error: No SVG files found", :red] exit 1 end # Single file mode vs batch mode if files_to_process.length == 1 && !@options[:directory] process_single_file(files_to_process.first) else process_batch(files_to_process) end end |