Class: GetText::Tools::Task::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/gettext/tools/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#domainObject (readonly)

Returns the value of attribute domain.



553
554
555
# File 'lib/gettext/tools/task.rb', line 553

def domain
  @domain
end

#localeObject (readonly)

Returns the value of attribute locale.



554
555
556
# File 'lib/gettext/tools/task.rb', line 554

def locale
  @locale
end

#mo_base_directoryObject (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_directoryObject (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_directoryObject



584
585
586
# File 'lib/gettext/tools/task.rb', line 584

def edit_po_directory
  po_directory
end

#edit_po_fileObject



588
589
590
# File 'lib/gettext/tools/task.rb', line 588

def edit_po_file
  edit_po_directory + "#{@domain}.edit.po"
end

#mo_directoryObject



592
593
594
# File 'lib/gettext/tools/task.rb', line 592

def mo_directory
  @mo_base_directory + @locale + "LC_MESSAGES"
end

#mo_fileObject



596
597
598
# File 'lib/gettext/tools/task.rb', line 596

def mo_file
  mo_directory + "#{@domain}.mo"
end

#po_directoryObject



566
567
568
# File 'lib/gettext/tools/task.rb', line 566

def po_directory
  @po_base_directory + @locale
end

#po_fileObject



570
571
572
# File 'lib/gettext/tools/task.rb', line 570

def po_file
  po_directory + "#{@domain}.po"
end

#po_file_is_updated?Boolean

Returns:

  • (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_fileObject



574
575
576
# File 'lib/gettext/tools/task.rb', line 574

def po_time_stamp_file
  po_directory + "#{@domain}.po.time_stamp"
end

#pot_fileObject



562
563
564
# File 'lib/gettext/tools/task.rb', line 562

def pot_file
  @po_base_directory + "#{@domain}.pot"
end