It is a required parameter.
@return [Array<String>] Supported locales. It is filled from
{#po_base_directory} by default.
@return [String] Base directory that has generated MOs. MOs
are generated into `#{mo_base_directory}/#{locale}/LC_MESSAGES/#{domain}.mo`.
@return [Array<String>] Command line options for filtering PO. @see GetText::Tools::MsgCat @see `rmsgcat --help` @since 3.1.3
@return [Array<String>] Command line options for creating PO from POT. @see GetText::Tools::MsgInit @see `rmsginit --help`
@return [Array<String>] Command line options for merging PO with the
latest POT.
@see GetText::Tools::MsgMerge @see `rmsgmerge --help`
It is useful when you have multiple domains. You can define tasks for each domains by using different namespace prefix.
It is `nil` by default. It means that tasks are defined at top level.
TODO: example
@return [String] Namespace prefix for tasks defined by this class.
It is used to custom how to create POT file. The object must have `call` method. The method must accept one argument. The argument
is a `Pathname` object that represents POT file path.
@example
GetText::Tools::Task.define do |task| task.pot_creator = lambda do |pot_file_path| pot_file_path.open("w") do |pot_file| pot_file << <<-POT msgid "Hello" msgstr "" POT end end end
@return [Proc]
@return [Array<String>] Command line options for extracting messages
from sources.
@see GetText::Tools::XGetText @see `rxgettext --help`
Define gettext related Rake tasks. Normally, use this method to define tasks because this method is a convenient API.
See accessor APIs how to configure this task.
See {define} for what task is defined.
@example Recommended usage
require "gettext/tools/task" # Recommended usage GetText::Tools::Task.define do |task| task.spec = spec # ... end # Low level API task = GetText::Tools::Task.new task.spec = spec # ... task.define
@yield [task] Gives the newely created task to the block. @yieldparam [GetText::Tools::Task] task The task that should be
configured.
@see define @return [void]
# File lib/gettext/tools/task.rb, line 73 def define task = new yield(task) task.define end
@param [Gem::Specification, nil] spec Package information associated
with the task. Some information are extracted from the spec.
@see spec= What information are extracted from the spec.
# File lib/gettext/tools/task.rb, line 175 def initialize(spec=nil) initialize_variables self.spec = spec if spec yield(self) if block_given? warn("Use #{self.class.name}.define instead of #{self.class.name}.new(spec).") define end end
Define tasks from configured parameters.
TODO: List defined Rake tasks.
# File lib/gettext/tools/task.rb, line 208 def define ensure_variables validate define_file_tasks if namespace_prefix namespace_recursive namespace_prefix do define_named_tasks end else define_named_tasks end end
If it is true, each task has description. Otherwise, all tasks doesn't have description.
@return [Bool] @since 3.0.1
# File lib/gettext/tools/task.rb, line 227 def enable_description? @enable_description end
Sets package infromation by Gem::Specification. Here is a list for information extracted from the spec:
* {#package_name} * {#package_version} * {#domain} * {#files}
@param [Gem::Specification] spec package information for the
i18n application.
# File lib/gettext/tools/task.rb, line 195 def spec=(spec) @spec = spec return if @spec.nil? @package_name = spec.name @package_version = spec.version.to_s @domain ||= spec.name @files += target_files end
Generated with the Darkfish Rdoc Generator 2.