aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/artifact/qlplugin.rb
blob: 298714d894bf5b2b6f87463e2d95b24b87388371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require "hbc/artifact/moved"

module Hbc
  module Artifact
    class Qlplugin < Moved
      def self.english_name
        "QuickLook Plugin"
      end

      def install_phase(**options)
        super(**options)
        reload_quicklook(**options)
      end

      def uninstall_phase(**options)
        super(**options)
        reload_quicklook(**options)
      end

      private

      def reload_quicklook(command: nil, **_)
        command.run!("/usr/bin/qlmanage", args: ["-r"])
      end
    end
  end
end