Sha256: 35418f279d45d18eaac54f6253e0ac19997728dc74d7f7178aa981641617e40f

Contents?: true

Size: 508 Bytes

Versions: 3

Compression:

Stored size: 508 Bytes

Contents

# frozen_string_literal: true

require_relative '../command'

module Expire
  module Commands
    # Remove files and directories
    class Remove < Expire::Command
      def initialize(path:)
        @path = path
      end

      attr_reader :path

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
expire-0.2.2 lib/expire/commands/remove.rb
expire-0.2.1 lib/expire/commands/remove.rb
expire-0.2.0 lib/expire/commands/remove.rb