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)
Defined Under Namespace
Classes: CheckError, DirectoryNotFoundError, FileNotFoundError, NoFilesFoundError
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.
19 20 21 22 |
# File 'lib/svg_conform/commands/check.rb', line 19 def initialize(files, ) @files = Array(files) = end |
Instance Method Details
#execute ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/svg_conform/commands/check.rb', line 24 def execute # Determine which files to process files_to_process = determine_files if files_to_process.empty? raise NoFilesFoundError, "No SVG files found" end # Single file mode vs batch mode if files_to_process.length == 1 && ![:directory] process_single_file(files_to_process.first) else process_batch(files_to_process) end end |