Sha256: 1f74d2cab5e5464deedb92ba73dd37a0aa18da37b37f6f646c41a2dc07ef60e7

Contents?: true

Size: 850 Bytes

Versions: 2

Compression:

Stored size: 850 Bytes

Contents

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

        cmd :xlsx_report,
            args: '[locale...]',
            desc: 'save missing and unused translations to an Excel file',
            opt:  [cmd_opt(:locales),
                   {short: :p, long: :path=, desc: 'Destination path', conf: {default: 'tmp/i18n-report.xlsx'}}]

        def xlsx_report(opt = {})
          begin
            require 'axlsx'
          rescue LoadError
            message = %Q(For spreadsheet report please add axlsx gem to Gemfile:\ngem 'axlsx', '~> 2.0')
            log_stderr Term::ANSIColor.red Term::ANSIColor.bold message
            exit 1
          end
          opt_locales! opt
          spreadsheet_report.save_report opt[:path], opt.except(:path)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i18n-tasks-0.7.1 lib/i18n/tasks/command/commands/xlsx.rb
i18n-tasks-0.7.0 lib/i18n/tasks/command/commands/xlsx.rb