Remove Locations module.
This commit is contained in:
parent
61bcec42a8
commit
458a1e7903
@ -292,19 +292,19 @@ module Hbc
|
||||
ohai "Enabling accessibility access"
|
||||
if MacOS.version <= :mountain_lion
|
||||
@command.run!("/usr/bin/touch",
|
||||
args: [Hbc.pre_mavericks_accessibility_dotfile],
|
||||
args: [MacOS.pre_mavericks_accessibility_dotfile],
|
||||
sudo: true)
|
||||
elsif MacOS.version <= :yosemite
|
||||
@command.run!("/usr/bin/sqlite3",
|
||||
args: [
|
||||
Hbc.tcc_db,
|
||||
MacOS.tcc_db,
|
||||
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL);",
|
||||
],
|
||||
sudo: true)
|
||||
elsif MacOS.version <= :el_capitan
|
||||
@command.run!("/usr/bin/sqlite3",
|
||||
args: [
|
||||
Hbc.tcc_db,
|
||||
MacOS.tcc_db,
|
||||
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL,NULL);",
|
||||
],
|
||||
sudo: true)
|
||||
@ -325,7 +325,7 @@ module Hbc
|
||||
ohai "Disabling accessibility access"
|
||||
@command.run!("/usr/bin/sqlite3",
|
||||
args: [
|
||||
Hbc.tcc_db,
|
||||
MacOS.tcc_db,
|
||||
"DELETE FROM access WHERE client='#{bundle_identifier}';",
|
||||
],
|
||||
sudo: true)
|
||||
|
||||
@ -19,14 +19,6 @@ module Hbc
|
||||
def default_tap
|
||||
@default_tap ||= Tap.fetch("homebrew", "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
|
||||
|
||||
@ -255,5 +255,13 @@ module OS
|
||||
def mdfind_query(*ids)
|
||||
ids.map! { |id| "kMDItemCFBundleIdentifier == #{id}" }.join(" || ")
|
||||
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
|
||||
|
||||
@ -16,7 +16,7 @@ describe "Accessibility Access", :cask do
|
||||
it "can enable accessibility access in macOS releases prior to Mavericks" do
|
||||
expect(fake_system_command).to receive(:run!).with(
|
||||
"/usr/bin/touch",
|
||||
args: [Hbc.pre_mavericks_accessibility_dotfile],
|
||||
args: [MacOS.pre_mavericks_accessibility_dotfile],
|
||||
sudo: true,
|
||||
)
|
||||
|
||||
@ -36,7 +36,7 @@ describe "Accessibility Access", :cask do
|
||||
it "can enable accessibility access" do
|
||||
expect(fake_system_command).to receive(:run!).with(
|
||||
"/usr/bin/sqlite3",
|
||||
args: [Hbc.tcc_db, "INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);"],
|
||||
args: [MacOS.tcc_db, "INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);"],
|
||||
sudo: true,
|
||||
)
|
||||
|
||||
@ -46,7 +46,7 @@ describe "Accessibility Access", :cask do
|
||||
it "can disable accessibility access" do
|
||||
expect(fake_system_command).to receive(:run!).with(
|
||||
"/usr/bin/sqlite3",
|
||||
args: [Hbc.tcc_db, "DELETE FROM access WHERE client='com.example.BasicCask';"],
|
||||
args: [MacOS.tcc_db, "DELETE FROM access WHERE client='com.example.BasicCask';"],
|
||||
sudo: true,
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user