Class: SnippetCli::Commands::Check
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- SnippetCli::Commands::Check
- Defined in:
- lib/snippet_cli/commands/check.rb
Instance Method Summary collapse
Methods included from WizardHelpers::MatchFileSelector
Methods included from WizardHelpers::PromptHelpers
#collect_search_terms, #confirm!, #list_confirm!, #optional_prompt, #prompt!
Methods included from WizardHelpers::ErrorHandler
Instance Method Details
#call(file: nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/snippet_cli/commands/check.rb', line 23 def call(file: nil, **) handle_errors(NoMatchFilesError) do file ||= pick_match_file.last data = YamlLoader.load(file) report(file, FileValidator.errors_structured(data)) end rescue FileMissingError, InvalidYamlError => e warn e. exit 1 end |