Sha256: b9b2db24a195ffcbbddf0ba2a57a539059feaccbc191217fac1e14a1231c4eda

Contents?: true

Size: 888 Bytes

Versions: 21

Compression:

Stored size: 888 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-].+?:)/, Rainbow('\1').cyan.bright)
          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

21 entries across 21 versions & 1 rubygems

Version Path
i18n-tasks-0.9.33 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.32 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.31 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.30 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.29 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.28 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.27 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.26 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.25 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.24 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.23 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.22 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.21 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.20 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.19 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.18 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.17 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.16 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.15 lib/i18n/tasks/command/commands/meta.rb
i18n-tasks-0.9.14 lib/i18n/tasks/command/commands/meta.rb