Class: GetText::Tools::Task::Path
- Inherits:
-
Object
- Object
- GetText::Tools::Task::Path
- Defined in:
- lib/gettext/tools/task.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#mo_base_directory ⇒ Object
readonly
Returns the value of attribute mo_base_directory.
-
#po_base_directory ⇒ Object
readonly
Returns the value of attribute po_base_directory.
Instance Method Summary collapse
- #edit_po_directory ⇒ Object
- #edit_po_file ⇒ Object
-
#initialize(po_base_directory, mo_base_directory, domain, locale = nil) ⇒ Path
constructor
A new instance of Path.
- #mo_directory ⇒ Object
- #mo_file ⇒ Object
- #po_directory ⇒ Object
- #po_file ⇒ Object
- #po_file_is_updated? ⇒ Boolean
- #po_time_stamp_file ⇒ Object
- #pot_file ⇒ Object
Constructor Details
#initialize(po_base_directory, mo_base_directory, domain, locale = nil) ⇒ Path
Returns a new instance of Path.
555 556 557 558 559 560 |
# File 'lib/gettext/tools/task.rb', line 555 def initialize(po_base_directory, mo_base_directory, domain, locale=nil) @po_base_directory = po_base_directory @mo_base_directory = mo_base_directory @domain = domain @locale = locale end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
553 554 555 |
# File 'lib/gettext/tools/task.rb', line 553 def domain @domain end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
554 555 556 |
# File 'lib/gettext/tools/task.rb', line 554 def locale @locale end |
#mo_base_directory ⇒ Object (readonly)
Returns the value of attribute mo_base_directory.
552 553 554 |
# File 'lib/gettext/tools/task.rb', line 552 def mo_base_directory @mo_base_directory end |
#po_base_directory ⇒ Object (readonly)
Returns the value of attribute po_base_directory.
551 552 553 |
# File 'lib/gettext/tools/task.rb', line 551 def po_base_directory @po_base_directory end |
Instance Method Details
#edit_po_directory ⇒ Object
584 585 586 |
# File 'lib/gettext/tools/task.rb', line 584 def edit_po_directory po_directory end |
#edit_po_file ⇒ Object
588 589 590 |
# File 'lib/gettext/tools/task.rb', line 588 def edit_po_file edit_po_directory + "#{@domain}.edit.po" end |
#mo_directory ⇒ Object
592 593 594 |
# File 'lib/gettext/tools/task.rb', line 592 def mo_directory @mo_base_directory + @locale + "LC_MESSAGES" end |
#mo_file ⇒ Object
596 597 598 |
# File 'lib/gettext/tools/task.rb', line 596 def mo_file mo_directory + "#{@domain}.mo" end |
#po_directory ⇒ Object
566 567 568 |
# File 'lib/gettext/tools/task.rb', line 566 def po_directory @po_base_directory + @locale end |
#po_file ⇒ Object
570 571 572 |
# File 'lib/gettext/tools/task.rb', line 570 def po_file po_directory + "#{@domain}.po" end |
#po_file_is_updated? ⇒ Boolean
578 579 580 581 582 |
# File 'lib/gettext/tools/task.rb', line 578 def po_file_is_updated? return false unless po_file.exist? return true unless po_time_stamp_file.exist? po_file.mtime > po_time_stamp_file.mtime end |
#po_time_stamp_file ⇒ Object
574 575 576 |
# File 'lib/gettext/tools/task.rb', line 574 def po_time_stamp_file po_directory + "#{@domain}.po.time_stamp" end |
#pot_file ⇒ Object
562 563 564 |
# File 'lib/gettext/tools/task.rb', line 562 def pot_file @po_base_directory + "#{@domain}.pot" end |