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



556
557
558
559
560
561
# File 'lib/gettext/tools/task.rb', line 556

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



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

def domain
  @domain
end

#localeObject (readonly)

Returns the value of attribute locale



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

def locale
  @locale
end

#mo_base_directoryObject (readonly)

Returns the value of attribute mo_base_directory



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

def mo_base_directory
  @mo_base_directory
end

#po_base_directoryObject (readonly)

Returns the value of attribute po_base_directory



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

def po_base_directory
  @po_base_directory
end

Instance Method Details

#edit_po_directoryObject



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

def edit_po_directory
  po_directory
end

#edit_po_fileObject



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

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

#mo_directoryObject



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

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

#mo_fileObject



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

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

#po_directoryObject



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

def po_directory
  @po_base_directory + @locale
end

#po_fileObject



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

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

#po_file_is_updated?Boolean

Returns:

  • (Boolean)


579
580
581
582
583
# File 'lib/gettext/tools/task.rb', line 579

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



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

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

#pot_fileObject



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

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