aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/locations.rb
blob: e55bdf15dc79915a3f06e50b036251b0c6f641fa (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
require "tap"

module Hbc
  module Locations
    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods
      attr_writer :caskroom

      def caskroom
        @caskroom ||= HOMEBREW_PREFIX.join("Caskroom")
      end

      attr_writer :cache

      def cache
        @cache ||= HOMEBREW_CACHE.join("Cask")
      end

      attr_writer :appdir

      def appdir
        @appdir ||= Pathname.new("/Applications").expand_path
      end

      attr_writer :prefpanedir

      def prefpanedir
        @prefpanedir ||= Pathname.new("~/Library/PreferencePanes").expand_path
      end

      attr_writer :qlplugindir

      def qlplugindir
        @qlplugindir ||= Pathname.new("~/Library/QuickLook").expand_path
      end

      attr_writer :dictionarydir

      def dictionarydir
        @dictionarydir ||= Pathname.new("~/Library/Dictionaries").expand_path
      end

      attr_writer :fontdir

      def fontdir
        @fontdir ||= Pathname.new("~/Library/Fonts").expand_path
      end

      attr_writer :colorpickerdir

      def colorpickerdir
        @colorpickerdir ||= Pathname.new("~/Library/ColorPickers").expand_path
      end

      attr_writer :servicedir

      def servicedir
        @servicedir ||= Pathname.new("~/Library/Services").expand_path
      end

      attr_writer :binarydir

      def binarydir
        @binarydir ||= HOMEBREW_PREFIX.join("bin")
      end

      attr_writer :input_methoddir

      def input_methoddir
        @input_methoddir ||= Pathname.new("~/Library/Input Methods").expand_path
      end

      attr_writer :internet_plugindir

      def internet_plugindir
        @internet_plugindir ||= Pathname.new("~/Library/Internet Plug-Ins").expand_path
      end

      attr_writer :audio_unit_plugindir

      def audio_unit_plugindir
        @audio_unit_plugindir ||= Pathname.new("~/Library/Audio/Plug-Ins/Components").expand_path
      end

      attr_writer :vst_plugindir

      def vst_plugindir
        @vst_plugindir ||= Pathname.new("~/Library/Audio/Plug-Ins/VST").expand_path
      end

      attr_writer :vst3_plugindir

      def vst3_plugindir
        @vst3_plugindir ||= Pathname.new("~/Library/Audio/Plug-Ins/VST3").expand_path
      end

      attr_writer :screen_saverdir

      def screen_saverdir
        @screen_saverdir ||= Pathname.new("~/Library/Screen Savers").expand_path
      end

      attr_writer :default_tap

      def default_tap
        @default_tap ||= Tap.fetch("caskroom", "homebrew-cask")
      end

      def tcc_db
        @tcc_db ||= Pathname.new("/Library/Application Support/com.apple.TCC/TCC.db")
      end

      def pre_mavericks_accessibility_dotfile
        @pre_mavericks_accessibility_dotfile ||= Pathname.new("/private/var/db/.AccessibilityAPIEnabled")
      end
    end
  end
end