Class: I18nJS::CLI::LintTranslationsCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/i18n-js/cli/lint_translations_command.rb

Instance Attribute Summary

Attributes inherited from Command

#argv, #ui

Instance Method Summary collapse

Methods inherited from Command

#call, command, command_name, description, #initialize, #options, parse

Constructor Details

This class inherits a constructor from I18nJS::CLI::Command

Instance Method Details

#build_list_with_label(list, label) ⇒ Object



151
152
153
# File 'lib/i18n-js/cli/lint_translations_command.rb', line 151

def build_list_with_label(list, label)
  list.map {|item| [item, label] }
end

#build_list_with_locale(list, locale) ⇒ Object



155
156
157
# File 'lib/i18n-js/cli/lint_translations_command.rb', line 155

def build_list_with_locale(list, locale)
  list.map {|item| "#{locale}.#{item}" }
end

#ignored?(matchers, key) ⇒ Boolean

Returns:

  • (Boolean)


159
160
161
# File 'lib/i18n-js/cli/lint_translations_command.rb', line 159

def ignored?(matchers, key)
  matchers.any? {|matcher| matcher.match?(key) }
end