Class: Expire::Commands::Oldest

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

Overview

Print the oldest backup

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) ⇒ Oldest

Returns a new instance of Oldest.



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

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

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

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



16
17
18
# File 'lib/expire/commands/oldest.rb', line 16

def execute(input: $stdin, output: $stdout)
  output.puts Expire.oldest(path).pathname
end