Module: I18n::Tasks::Command::Commands::Health

Includes:
I18n::Tasks::Command::Collection
Included in:
I18n::Tasks::Commands
Defined in:
lib/i18n/tasks/command/commands/health.rb

Instance Method Summary collapse

Methods included from I18n::Tasks::Command::Collection

included

Instance Method Details

#health(opt = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/i18n/tasks/command/commands/health.rb', line 14

def health(opt = {})
  forest = i18n.data_forest(opt[:locales])
  stats  = i18n.forest_stats(forest)
  fail CommandError, t('i18n_tasks.health.no_keys_detected') if stats[:key_count].zero?

  terminal_report.forest_stats forest, stats
  [
    missing(**opt),
    unused(**opt),
    check_consistent_interpolations(**opt),
    check_normalized(**opt)
  ].detect { |result| result == :exit1 }
end