Sha256: a24dcbfc39563e2bbc8acd287cbe2587a438d699a61c9b206a6b6411e6790284

Contents?: true

Size: 482 Bytes

Versions: 2

Compression:

Stored size: 482 Bytes

Contents

# frozen_string_literal: true

module Pbmenv
  class DestroyVersionService
    class VersionNotFoundError < StandardError; end

    attr_accessor :version

    def initialize(version: )
      @version = version
    end

    def execute!
      version_pathname = VersionPathname.new(version)

      unless File.exist?(version_pathname.version_path)
        raise VersionNotFoundError
      end
      Helper.system_and_puts "rm -rf #{version_pathname.version_path}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pbmenv-0.1.13 lib/pbmenv/services/destroy_version_service.rb
pbmenv-0.1.12 lib/pbmenv/services/destroy_version_service.rb