Sha256: 3ac24f99843c5ec31e809b30200db193c640c144d8930e392e613dbec9f1c768

Contents?: true

Size: 682 Bytes

Versions: 7

Compression:

Stored size: 682 Bytes

Contents

module I18n::Tasks
  module Command
    module Commands
      module Health
        include Command::Collection

        cmd :health,
            pos:  '[locale ...]',
            desc: t('i18n_tasks.cmd.desc.health'),
            args: [:locales, :out_format]

        def health(opt = {})
          forest = i18n.data_forest(opt[:locales])
          stats  = i18n.forest_stats(forest)
          if stats[:key_count].zero?
            raise CommandError.new t('i18n_tasks.health.no_keys_detected')
          end
          terminal_report.forest_stats forest, stats
          [missing(opt), unused(opt)].detect { |result| result == :exit_1 }
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
i18n-tasks-0.9.2 lib/i18n/tasks/command/commands/health.rb
i18n-tasks-0.9.1 lib/i18n/tasks/command/commands/health.rb
i18n-tasks-0.9.0 lib/i18n/tasks/command/commands/health.rb
i18n-tasks-0.9.0.rc2 lib/i18n/tasks/command/commands/health.rb
i18n-tasks-0.8.7 lib/i18n/tasks/command/commands/health.rb
i18n-tasks-0.9.0.rc1 lib/i18n/tasks/command/commands/health.rb
i18n-tasks-0.8.6 lib/i18n/tasks/command/commands/health.rb