Sha256: 583fead67a0e6e5990c247dd451dd94d16f5a2b3917bd4e90b70ff6581fce9a7

Contents?: true

Size: 662 Bytes

Versions: 14

Compression:

Stored size: 662 Bytes

Contents

module Manpages
  class Uninstall
    def initialize(gem_spec, gem_dir, target_dir)
      @gem_spec   = gem_spec
      @gem_dir    = gem_dir
      @target_dir = target_dir
    end

    def uninstall_manpages
      unlink_manpages if GemVersion.new(@gem_spec).latest?
    end

  private

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

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

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/manpages-0.6.1/lib/manpages/uninstall.rb
manpages-0.6.1 lib/manpages/uninstall.rb
manpages-0.6.0 lib/manpages/uninstall.rb
manpages-0.5.2 lib/manpages/uninstall.rb
manpages-0.5.1 lib/manpages/uninstall.rb
manpages-0.5.0 lib/manpages/uninstall.rb
manpages-0.4.0 lib/manpages/uninstall.rb