Class: Glossarist::CLI::ValidateCommand
- Inherits:
-
Object
- Object
- Glossarist::CLI::ValidateCommand
- Defined in:
- lib/glossarist/cli/validate_command.rb
Instance Method Summary collapse
-
#initialize(path, options) ⇒ ValidateCommand
constructor
A new instance of ValidateCommand.
- #run ⇒ Object
Constructor Details
#initialize(path, options) ⇒ ValidateCommand
Returns a new instance of ValidateCommand.
6 7 8 9 |
# File 'lib/glossarist/cli/validate_command.rb', line 6 def initialize(path, ) @path = path @options = end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/glossarist/cli/validate_command.rb', line 11 def run result = DatasetValidator.new.validate( @path, strict: @options[:strict], reference_path: @options[:reference_path], ) report(result) exit_code = result.errors.any? || (@options[:strict] && result.warnings.any?) ? 1 : 0 exit(exit_code) unless exit_code.zero? end |