Sha256: 79c5c2d62d27aa7395e9f4db86dffe0f3f05d5bdfb2e6f21b7af15faa6def815

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

require 'rubygems'
require 'fileutils'

# See ext/install/Rakefile for why this cleanup is our responsibility.
# Decide if user uninstalled executables based on our actual Ruby script.
Gem.post_uninstall do |gem|
  uninstalling_shoes = gem.spec.name == "shoes"
  missing_executable = !File.exist?(File.join(Gem.bindir, "shoes-stub")) &&
                       !File.exist?(File.join(Gem.bindir, "shoes-stub.bat"))

  if uninstalling_shoes && missing_executable
    puts "Removing shoes"
    if Gem.win_platform?
      FileUtils.rm(File.join(Gem.bindir, "shoes.bat"))
    else
      FileUtils.rm(File.join(Gem.bindir, "shoes"))
    end

    # Everybody potentially has a generated backend file in their bin
    puts "Removing shoes-backend"
    backend = File.join(Gem.bindir, "shoes-backend")
    FileUtils.rm(backend) if File.exist?(backend)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-4.0.0.pre8 lib/rubygems_plugin.rb