Sha256: c0b2cddabd5288ee7ad48ace16dc0e7b21bab6d3d3d73d6ed3f0dbd110d4f88b

Contents?: true

Size: 556 Bytes

Versions: 2

Compression:

Stored size: 556 Bytes

Contents

module Manpages

  class Uninstall

    def initialize(gem_dir, target_dir)
      @gem_dir    = gem_dir
      @target_dir = target_dir
    end

    def uninstall_manpages
      ManFiles.new(@gem_dir, @target_dir).manpages.each do |file|
        unlink_manpage(file)
      end
    end

    private

    def unlink_manpage(file)
      man_target_file = ManFiles.new(@gem_dir, @target_dir).man_file_path(file)
      if File.symlink?(man_target_file) && File.readlink(man_target_file) == file
        FileUtils.rm(man_target_file)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
manpages-0.2.1 lib/manpages/uninstall.rb
manpages-0.2.0 lib/manpages/uninstall.rb