Module: I18n::Tasks

Defined in:
lib/i18n/tasks.rb,
lib/i18n/tasks/data.rb,
lib/i18n/tasks/stats.rb,
lib/i18n/tasks/version.rb,
lib/i18n/tasks/commands.rb,
lib/i18n/tasks/base_task.rb,
lib/i18n/tasks/html_keys.rb,
lib/i18n/tasks/split_key.rb,
lib/i18n/tasks/used_keys.rb,
lib/i18n/tasks/references.rb,
lib/i18n/tasks/command/dsl.rb,
lib/i18n/tasks/locale_list.rb,
lib/i18n/tasks/translation.rb,
lib/i18n/tasks/unused_keys.rb,
lib/i18n/tasks/missing_keys.rb,
lib/i18n/tasks/command_error.rb,
lib/i18n/tasks/interpolations.rb,
lib/i18n/tasks/console_context.rb,
lib/i18n/tasks/locale_pathname.rb,
lib/i18n/tasks/data/file_system.rb,
lib/i18n/tasks/reports/terminal.rb,
lib/i18n/tasks/command/commander.rb,
lib/i18n/tasks/data/file_formats.rb,
lib/i18n/tasks/command/collection.rb,
lib/i18n/tasks/data/tree/traversal.rb,
lib/i18n/tasks/command/options/data.rb,
lib/i18n/tasks/string_interpolation.rb,
lib/i18n/tasks/command/commands/data.rb,
lib/i18n/tasks/command/commands/meta.rb,
lib/i18n/tasks/command/commands/tree.rb,
lib/i18n/tasks/data/file_system_base.rb,
lib/i18n/tasks/command/options/common.rb,
lib/i18n/tasks/scanners/relative_keys.rb,
lib/i18n/tasks/command/commands/health.rb,
lib/i18n/tasks/command/commands/usages.rb,
lib/i18n/tasks/command/options/locales.rb,
lib/i18n/tasks/command/commands/eq_base.rb,
lib/i18n/tasks/command/commands/missing.rb,
lib/i18n/tasks/data/adapter/json_adapter.rb,
lib/i18n/tasks/data/adapter/yaml_adapter.rb,
lib/i18n/tasks/data/router/pattern_router.rb,
lib/i18n/tasks/command/option_parsers/enum.rb,
lib/i18n/tasks/scanners/results/occurrence.rb,
lib/i18n/tasks/translators/base_translator.rb,
lib/i18n/tasks/data/router/isolating_router.rb,
lib/i18n/tasks/command/option_parsers/locale.rb,
lib/i18n/tasks/command/commands/interpolations.rb,
lib/i18n/tasks/data/router/conservative_router.rb,
lib/i18n/tasks/scanners/occurrence_from_position.rb

Defined Under Namespace

Modules: Command, Concurrent, Configuration, Data, HtmlKeys, IgnoreKeys, Interpolations, KeyPatternMatching, LocaleList, LocalePathname, Logging, MissingKeys, PluralKeys, References, Reports, Scanners, SplitKey, Stats, StringInterpolation, Translation, Translators, UnusedKeys, UsedKeys Classes: BaseTask, CLI, CommandError, Commands, ConsoleContext

Constant Summary collapse

VERSION =
'1.0.14'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.verbose=(value) ⇒ Object (writeonly)

Sets the attribute verbose

Parameters:

  • value

    the value to set the attribute verbose to.



15
16
17
# File 'lib/i18n/tasks.rb', line 15

def verbose=(value)
  @verbose = value
end

Class Method Details

.add_ast_matcher(matcher_class_name) ⇒ Object

Add AST-matcher to i18n-tasks

Parameters:

  • matcher_class_name

Returns:

  • self



42
43
44
45
46
47
# File 'lib/i18n/tasks.rb', line 42

def add_ast_matcher(matcher_class_name)
  matchers = I18n::Tasks::Configuration::DEFAULTS[:search][:ast_matchers]
  matchers << matcher_class_name
  matchers.uniq!
  self
end

.add_commands(commands_module) ⇒ Object

Add commands to i18n-tasks

Parameters:

  • commands_module (Module)

Returns:

  • self



33
34
35
36
# File 'lib/i18n/tasks.rb', line 33

def add_commands(commands_module)
  ::I18n::Tasks::Commands.send :include, commands_module
  self
end

.add_scanner(scanner_class_name, scanner_opts = {}) ⇒ Object

Add a scanner to the default configuration.

Parameters:

  • scanner_class_name (String)
  • scanner_opts (Hash) (defaults to: {})

Returns:

  • self



22
23
24
25
26
27
# File 'lib/i18n/tasks.rb', line 22

def add_scanner(scanner_class_name, scanner_opts = {})
  scanners = I18n::Tasks::Configuration::DEFAULTS[:search][:scanners]
  scanners << [scanner_class_name, scanner_opts]
  scanners.uniq!
  self
end

.gem_pathObject



7
8
9
# File 'lib/i18n/tasks.rb', line 7

def gem_path
  File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
end

.verbose?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/i18n/tasks.rb', line 11

def verbose?
  @verbose
end