Class: I18nContextGenerator::ConfigCommand

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

Overview

Configuration inspection commands kept separate from extraction options.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/i18n_context_generator/cli.rb', line 9

def self.exit_on_failure?
  true
end

Instance Method Details

#validate(path = '.i18n-context-generator.yml') ⇒ Object



14
15
16
17
18
19
20
# File 'lib/i18n_context_generator/cli.rb', line 14

def validate(path = '.i18n-context-generator.yml')
  Config.from_file(path).validate!
  say "Configuration is valid (schema version #{Config::Schema::VERSION}): #{path}"
rescue I18nContextGenerator::Error => e
  warn "Error: #{e.message}"
  exit 1
end