-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb23433
commit 99e0454
Showing
14 changed files
with
214 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,3 +266,5 @@ def self.app_management_permissions_granted?(app:, command:) | |
end | ||
end | ||
end | ||
|
||
require "extend/os/cask/quarantine" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "extend/os/mac/cask/artifact/moved" if OS.mac? | ||
require "extend/os/linux/cask/artifact/moved" if OS.linux? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "extend/os/mac/cask/config" if OS.mac? | ||
require "extend/os/linux/cask/config" if OS.linux? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "extend/os/linux/cask/quarantine" if OS.linux? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
module OS | ||
module Linux | ||
module Cask | ||
module Artifact | ||
module Moved | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Artifact::Moved } | ||
|
||
sig { params(target: Pathname).returns(T::Boolean) } | ||
def undeletable?(_target) | ||
false | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Artifact::Moved.prepend(OS::Linux::Cask::Config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "os/linux" | ||
|
||
module OS | ||
module Linux | ||
module Cask | ||
module Config | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Config } | ||
|
||
DEFAULT_DIRS = T.let({ | ||
vst_plugindir: "~/.vst", | ||
vst3_plugindir: "~/.vst3", | ||
fontdir: "#{ENV.fetch("XDG_DATA_HOME", "~/.local/share")}/fonts", | ||
appdir: nil, | ||
keyboard_layoutdir: nil, | ||
colorpickerdir: nil, | ||
prefpanedir: nil, | ||
qlplugindir: nil, | ||
mdimporterdir: nil, | ||
servicedir: nil, | ||
dictionarydir: nil, | ||
screen_saverdir: nil, | ||
input_methoddir: nil, | ||
internet_plugindir: nil, | ||
audio_unit_plugindir: nil, | ||
}.freeze, T::Hash[Symbol, T.nilable(String)]) | ||
|
||
sig { returns(T::Hash[Symbol, T.untyped]) } | ||
def self.defaults | ||
{ | ||
languages: LazyObject.new { Linux.languages }, | ||
}.merge(DEFAULT_DIRS).freeze | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Config.prepend(OS::Linux::Cask::Config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
module OS | ||
module Linux | ||
module Cask | ||
module Quarantine | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Quarantine } | ||
|
||
sig { returns(Symbol) } | ||
def self.check_quarantine_support | ||
:linux | ||
end | ||
|
||
sig { returns(T::Boolean) } | ||
def self.available? | ||
false | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Quarantine.prepend(OS::Linux::Cask::Quarantine) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "cask/macos" | ||
|
||
module OS | ||
module Mac | ||
module Cask | ||
module Artifact | ||
module Moved | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Artifact::Moved } | ||
|
||
sig { params(target: Pathname).returns(T::Boolean) } | ||
def undeletable?(target) | ||
MacOS.undeletable?(target) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Artifact::Moved.prepend(OS::Mac::Cask::Config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "cask/macos" | ||
|
||
module OS | ||
module Mac | ||
module Cask | ||
module Config | ||
extend T::Helpers | ||
|
||
requires_ancestor { ::Cask::Config } | ||
|
||
DEFAULT_DIRS = T.let( | ||
{ | ||
appdir: "/Applications", | ||
keyboard_layoutdir: "/Library/Keyboard Layouts", | ||
colorpickerdir: "~/Library/ColorPickers", | ||
prefpanedir: "~/Library/PreferencePanes", | ||
qlplugindir: "~/Library/QuickLook", | ||
mdimporterdir: "~/Library/Spotlight", | ||
dictionarydir: "~/Library/Dictionaries", | ||
fontdir: "~/Library/Fonts", | ||
servicedir: "~/Library/Services", | ||
input_methoddir: "~/Library/Input Methods", | ||
internet_plugindir: "~/Library/Internet Plug-Ins", | ||
audio_unit_plugindir: "~/Library/Audio/Plug-Ins/Components", | ||
vst_plugindir: "~/Library/Audio/Plug-Ins/VST", | ||
vst3_plugindir: "~/Library/Audio/Plug-Ins/VST3", | ||
screen_saverdir: "~/Library/Screen Savers", | ||
}.freeze, | ||
T::Hash[Symbol, String], | ||
) | ||
|
||
sig { returns(T::Hash[Symbol, T.untyped]) } | ||
def self.defaults | ||
{ | ||
languages: LazyObject.new { MacOS.languages }, | ||
}.merge(DEFAULT_DIRS).freeze | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
Cask::Config.prepend(OS::Mac::Cask::Config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters