Class: Kiba::Extend::Utils::PreJobBackupTask
- Inherits:
-
PreJobTask
- Object
- PreJobTask
- Kiba::Extend::Utils::PreJobBackupTask
- Defined in:
- lib/kiba/extend/utils/pre_job_backup_task.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
-
#initialize ⇒ PreJobBackupTask
constructor
A new instance of PreJobBackupTask.
Constructor Details
#initialize ⇒ PreJobBackupTask
Returns a new instance of PreJobBackupTask.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/kiba/extend/utils/pre_job_backup_task.rb', line 13 def initialize setting = :pre_job_task_backup_dir return unless configured?(setting) backup_setting = Kiba::Extend.send(setting) return unless valid_backup?(backup_setting) @backup_dir = backup_setting @timestamp = Time.now.strftime("%y-%m-%d_%H-%M") super end |
Class Method Details
.call ⇒ Object
8 9 10 |
# File 'lib/kiba/extend/utils/pre_job_backup_task.rb', line 8 def call new.call end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 |
# File 'lib/kiba/extend/utils/pre_job_backup_task.rb', line 26 def call return unless runnable? dirs.each { |dir| backup(dir) } end |