Class: GetText::Task

Inherits:
Object
  • Object
show all
Includes:
GetText, Rake::DSL
Defined in:
lib/gettext/task.rb

Constant Summary

Constants included from GetText

BOM_UTF8, MOFile, MoFile, PoParser, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GetText

#N_, #Nn_, #bindtextdomain, #bindtextdomain_to, #cgi, #cgi=, #create_mofiles, #create_mofiles_org, #gettext, included, #locale, #msgmerge, #ngettext, #npgettext, #nsgettext, #output_charset, #pgettext, #remove_bom, #set_cgi, #set_current_locale, #set_locale, #set_output_charset, #sgettext, #textdomain, #textdomain_to, #update_pofiles, #update_pofiles_org

Constructor Details

#initialize(spec) {|_self| ... } ⇒ Task

Returns a new instance of Task.

Yields:

  • (_self)

Yield Parameters:

  • _self (GetText::Task)

    the object that the method was called on



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/gettext/task.rb', line 29

def initialize(spec)
  @spec = spec
  @locales = []
  @po_base_directory = "po"
  @mo_base_directory = "."
  @files = target_files
  @domain = @spec.name
  @namespace_prefix = nil
  yield(self) if block_given?
  @locales = detect_locales if @locales.empty?
  raise("must set locales: #{inspect}") if @locales.empty?
  define
end

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



27
28
29
# File 'lib/gettext/task.rb', line 27

def domain
  @domain
end

#filesObject

Returns the value of attribute files.



28
29
30
# File 'lib/gettext/task.rb', line 28

def files
  @files
end

#localesObject

Returns the value of attribute locales.



27
28
29
# File 'lib/gettext/task.rb', line 27

def locales
  @locales
end

#mo_base_directoryObject

Returns the value of attribute mo_base_directory.



27
28
29
# File 'lib/gettext/task.rb', line 27

def mo_base_directory
  @mo_base_directory
end

#namespace_prefixObject

Returns the value of attribute namespace_prefix.



28
29
30
# File 'lib/gettext/task.rb', line 28

def namespace_prefix
  @namespace_prefix
end

#po_base_directoryObject

Returns the value of attribute po_base_directory.



27
28
29
# File 'lib/gettext/task.rb', line 27

def po_base_directory
  @po_base_directory
end