class PhTools::Phfixfmd
Public Class Methods
about()
click to toggle source
# File lib/phfixfmd.rb, line 10 def self.about 'fixes FileModifyDate to be equal to date-time-in-the-name' end
Private Instance Methods
process_file(phfile)
click to toggle source
# File lib/phfixfmd.rb, line 16 def process_file(phfile) fail PhTools::Error, 'wrong date-time-in-the-name' unless phfile.date_time_ok? begin File.utime(Time.now, phfile.date_time_to_time, phfile.filename) rescue raise PhTools::Error.new, 'setting file modify date' end phfile end