Sha256: 272d2edd11ce3b68937b888158f6e9819ac0f58570f04eca6b72cefb4463e9a6

Contents?: true

Size: 910 Bytes

Versions: 6

Compression:

Stored size: 910 Bytes

Contents

# frozen_string_literal: true
module I18n::Tasks
  module Command
    module Commands
      module Meta
        include Command::Collection

        cmd :config,
            pos:  '[section ...]',
            desc: t('i18n_tasks.cmd.desc.config')

        def config(opts = {})
          cfg = i18n.config_for_inspect
          cfg = cfg.slice(*opts[:arguments]) if opts[:arguments].present?
          cfg = cfg.to_yaml
          cfg.sub!(/\A---\n/, '')
          cfg.gsub!(/^([^\s-].+?:)/, Term::ANSIColor.cyan(Term::ANSIColor.bold('\1')))
          puts cfg
        end

        cmd :gem_path, desc: t('i18n_tasks.cmd.desc.gem_path')

        def gem_path
          puts I18n::Tasks.gem_path
        end

        cmd :irb, desc: t('i18n_tasks.cmd.desc.irb')

        def irb
          require 'i18n/tasks/console_context'
          ::I18n::Tasks::ConsoleContext.start
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
i18n-tasks-0.9.12 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.11 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.10 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.9 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.8 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.7 lib/i18n/tasks/command/commands/meta.rb