Class: Expire::Commands::Purge

Inherits:
Expire::Command show all
Defined in:
lib/expire/commands/purge.rb

Overview

Purge expired backups

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expire::Command

#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(path, options) ⇒ Purge



9
10
11
12
# File 'lib/expire/commands/purge.rb', line 9

def initialize(path, options)
  @path = path
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'lib/expire/commands/purge.rb', line 14

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



14
15
16
# File 'lib/expire/commands/purge.rb', line 14

def path
  @path
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



16
17
18
19
20
# File 'lib/expire/commands/purge.rb', line 16

def execute(input: $stdin, output: $stdout)
  Expire.purge(path, options)
rescue => _e
  exit 1
end