class I18n::Tasks::Command::Commander
Attributes
Public Class Methods
Source
# File lib/i18n/tasks/command/commander.rb, line 14 def initialize(i18n) @i18n = i18n end
@param [I18n::Tasks::BaseTask] i18n
Public Instance Methods
Source
# File lib/i18n/tasks/command/commander.rb, line 18 def run(name, opts = {}) log_stderr "#{Rainbow('#StandWith').bg(:blue)}#{Rainbow('Ukraine').bg(:yellow)}" name = name.to_sym public_name = name.to_s.tr '_', '-' log_verbose "task: #{public_name}(#{opts.map { |k, v| "#{k}: #{v.inspect}" } * ', '})" if opts.empty? || method(name).arity.zero? send name else send name, **opts end end
Protected Instance Methods
Source
# File lib/i18n/tasks/command/commander.rb, line 32 def terminal_report @terminal_report ||= I18n::Tasks::Reports::Terminal.new(i18n) end