Class: GettextColumnMapping::Tasks

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/gettext_column_mapping/tasks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version, domain = nil) {|_self| ... } ⇒ Tasks

Returns a new instance of Tasks.

Yields:

  • (_self)

Yield Parameters:



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gettext_column_mapping/tasks.rb', line 8

def initialize(version, domain = nil, &block)
  @test_paths = []
  @require_libs = []
  @require_test_libs = []
  @require_files = []
  @options_store = {}
  @po_pattern = nil
  @options_finder = {}
  @locale_path = 'locale'
  @version = version
  @text_domain = domain
  yield self if block_given?
  verify_variables
  define
end

Instance Attribute Details

#lib_pathsObject

Returns the value of attribute lib_paths.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def lib_paths
  @lib_paths
end

#locale_pathObject

Returns the value of attribute locale_path.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def locale_path
  @locale_path
end

#mo_argsObject

Returns the value of attribute mo_args.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def mo_args
  @mo_args
end

#options_finderObject

Returns the value of attribute options_finder.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def options_finder
  @options_finder
end

#options_storeObject

Returns the value of attribute options_store.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def options_store
  @options_store
end

#po_patternObject

Returns the value of attribute po_pattern.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def po_pattern
  @po_pattern
end

#require_filesObject

Returns the value of attribute require_files.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def require_files
  @require_files
end

#require_libsObject

Returns the value of attribute require_libs.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def require_libs
  @require_libs
end

#require_test_libsObject

Returns the value of attribute require_test_libs.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def require_test_libs
  @require_test_libs
end

#test_pathsObject

Returns the value of attribute test_paths.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def test_paths
  @test_paths
end

#text_domainObject

Returns the value of attribute text_domain.



5
6
7
# File 'lib/gettext_column_mapping/tasks.rb', line 5

def text_domain
  @text_domain
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/gettext_column_mapping/tasks.rb', line 6

def version
  @version
end

Instance Method Details

#load_gettextObject



34
35
36
37
# File 'lib/gettext_column_mapping/tasks.rb', line 34

def load_gettext
  require 'gettext'
  require 'gettext/utils'
end

#po_rootObject



39
40
41
# File 'lib/gettext_column_mapping/tasks.rb', line 39

def po_root
  options_store[:po_root] || locale_path
end

#verify_variablesObject



24
25
26
27
28
# File 'lib/gettext_column_mapping/tasks.rb', line 24

def verify_variables
 @options_finder = {:to => File.join(locale_path, 'data.rb')}.merge(@options_finder)
 @options_store = {:po_root => locale_path}.merge(@options_store)
 @po_pattern ||= "locale/data.rb"
end