Class: Pione::Command::PioneCleanContext

Inherits:
Rootage::CommandContext show all
Defined in:
lib/pione/command/pione-clean.rb

Overview

PioneCleanContext is a process context for pione-clean-context.

Instance Attribute Summary

Attributes inherited from Rootage::ProcessContext

#model, #scenario

Instance Method Summary collapse

Methods inherited from Rootage::CommandContext

#quit, #stop

Methods inherited from Rootage::ProcessContext

#fail, #initialize, make, #test

Constructor Details

This class inherits a constructor from Rootage::ProcessContext

Instance Method Details

#delete?(entry) ⇒ Boolean

Return true if the entry should be removed.

Returns:

  • (Boolean)


168
169
170
# File 'lib/pione/command/pione-clean.rb', line 168

def delete?(entry)
  not(entry.exist?) or model[:older].nil? or model[:older] >= entry.mtime.to_date
end

#type?(type) ⇒ Boolean

Return true if the type is matched.

Returns:

  • (Boolean)


163
164
165
# File 'lib/pione/command/pione-clean.rb', line 163

def type?(type)
  model[:type] == "all" or model[:type] == type
end