Sha256: 99a18077ad8232293b8efdddb467de0c3712e7c76f4b1a77bd7768d3d91dc8a1

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

module InstallGemLocal
  module RemoveGem
    def remove_gem
      file_exists = file_names
      if file_exists.count > 1
        remove_file_from_path(multiple_version_selection(include_all: true))
      elsif file_exists.count == 1
        remove_file_from_path(file_exists.first)
      else
        ap 'Gem not exist'
      end
    end

    def remove_file_from_path(file_name)
      return if file_name == 'exit'

      if file_name == 'all'
        tty_command.run('rm *.gem')
      else
        tty_command.run("rm #{file_name}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
install_gem_local-0.1.7 lib/install_gem_local/action/remove_gem.rb