Sha256: 03865e5b300594b59ce063d7e5f666d08d29e75adc9ce33e3680eac356d904ea

Contents?: true

Size: 483 Bytes

Versions: 2

Compression:

Stored size: 483 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.exists?(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.11 lib/pbmenv/services/destroy_version_service.rb
pbmenv-0.1.10 lib/pbmenv/destroy_version_service.rb