class Expire::Commands::Remove

Remove files and directories

Attributes

path[R]

Public Class Methods

new(path:) click to toggle source
# File lib/expire/commands/remove.rb, line 9
def initialize(path:)
  @path = path
end

Public Instance Methods

execute(output: $stdout) click to toggle source
# File lib/expire/commands/remove.rb, line 15
def execute(output: $stdout)
  begin
    Expire.remove(path)
  rescue Errno::ENOENT => e
    output.puts "can't remove #{path}: #{e}"
    exit 1
  end
  output.puts "removed #{path}"
end