lib/eco/data/files/helpers.rb in eco-helpers-2.5.3 vs lib/eco/data/files/helpers.rb in eco-helpers-2.5.4
- old
+ new
@@ -73,14 +73,14 @@
def dir_exists?(path)
Dir.exist?(path) || Dir.exist?(File.expand_path(path))
end
- def timestamp(timestamp_pattern = DEFAULT_TIMESTAMP_PATTERN)
- Time.now.strftime(timestamp_pattern)
+ def timestamp(timestamp_pattern = DEFAULT_TIMESTAMP_PATTERN, date = Time.now)
+ date.strftime(timestamp_pattern)
end
- def timestamp_file(filename, timestamp_pattern = DEFAULT_TIMESTAMP_PATTERN)
+ def timestamp_file(filename, timestamp_pattern =DEFAULT_TIMESTAMP_PATTERN)
file_pattern = Eco::Data::Files::FilePattern.new(filename)
file_pattern.resolve(start: timestamp(timestamp_pattern) + '_')
end
def copy_file(source_file, dest_file, time_stamp: false)