Module: I18n::Processes::Command::Commands::Health

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

Instance Method Summary collapse

Methods included from I18n::Processes::Command::Collection

included

Instance Method Details

#health(opt = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/i18n/processes/command/commands/health.rb', line 15

def health(opt = {})
  forest = i18n.data_forest(opt[:locales])
  stats  = i18n.forest_stats(forest)
  fail CommandError, 'No keys detected. Check data.read in config/i18n-processes.yml.' if stats[:key_count].zero?
  terminal_report.forest_stats forest, stats
  $stderr.puts Rainbow("#{opt}").green
  [missing(opt), unused(opt), check_normalized(opt)].detect { |result| result == :exit_1 }
end