Sha256: dd13b83fe62e9596d8e853f02643ef5cfdc610d79a98c0e2a6f12697bc2caeed

Contents?: true

Size: 884 Bytes

Versions: 2

Compression:

Stored size: 884 Bytes

Contents

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

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

        def config(opts = {})
          cfg = i18n.config_for_inspect
          cfg = cfg.slice(*opts[:arguments]) if opts[:arguments]
          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: I18n.t('i18n_tasks.cmd.desc.gem_path')

        def gem_path
          puts I18n::Tasks.gem_path
        end

        cmd :irb, desc: I18n.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

2 entries across 2 versions & 1 rubygems

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