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
19
20
21
|
# File 'lib/avm/data/dumper.rb', line 19
def cannot_perform_reason
nil
end
|
#default_dump_path ⇒ Pathname
24
25
26
27
28
29
|
# File 'lib/avm/data/dumper.rb', line 24
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
32
33
34
|
# File 'lib/avm/data/dumper.rb', line 32
def target_path_expired?
target_path_time.if_present(true) { |v| v >= expire_time }
end
|
#target_path_time ⇒ ActiveSupport::Duration?
37
38
39
|
# File 'lib/avm/data/dumper.rb', line 37
def target_path_time
target_path.exist? ? ::Time.now - ::File.mtime(target_path) : nil
end
|