Class: Avm::Data::Dumper
Constant Summary
collapse
- DEFAULT_EXPIRE_TIME =
1.day
- DEFAULT_OVERWRITE =
false
- DEFAULT_ROTATE =
true
Instance Method Summary
collapse
Methods inherited from Performer
#immutable_constructor_args, #perform, #performable?
Instance Method Details
16
17
18
|
# File 'lib/avm/data/dumper.rb', line 16
def cannot_perform_reason
nil
end
|
#default_dump_path ⇒ Pathname
21
22
23
24
25
26
|
# File 'lib/avm/data/dumper.rb', line 21
def default_dump_path
r = data_owner.data_default_dump_path
include_excludes_path_suffix.if_present(r) do |v|
r.basename_sub('.*') { |b| "#{b}#{v}#{r.extname}" }
end
end
|
#target_path_expired? ⇒ Boolean
29
30
31
|
# File 'lib/avm/data/dumper.rb', line 29
def target_path_expired?
target_path_time.if_present(true) { |v| v >= expire_time }
end
|
#target_path_time ⇒ ActiveSupport::Duration?
34
35
36
|
# File 'lib/avm/data/dumper.rb', line 34
def target_path_time
target_path.exist? ? ::Time.now - ::File.mtime(target_path) : nil
end
|