Class: RunLoop::CLI::TCC
- Inherits:
-
Thor
- Object
- Thor
- RunLoop::CLI::TCC
- Defined in:
- lib/run_loop/cli/tcc.rb
Instance Method Summary collapse
Instance Method Details
#allow ⇒ Object
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 |
# File 'lib/run_loop/cli/tcc.rb', line 66 def allow debug = [:debug] device = [:device] if device devices = [expect_device()] else devices = sim_control.simulators end service = [:service] if service services = [service] else services = RunLoop::TCC::PRIVACY_SERVICES.map do |key, _| key end end app = [:app] RunLoop::Environment.with_debugging(debug) do devices.each do |_device| tcc = RunLoop::TCC.new(_device, app) services.each do |_service| tcc.allow_service(_service) end end end true end |
#open ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/run_loop/cli/tcc.rb', line 25 def open device = expect_device() tcc_db = device.simulator_tcc_db return false if tcc_db.nil? args = ['open', tcc_db] pid = Process.spawn(*args) Process.detach(pid) pid end |
#services ⇒ Object
11 12 13 14 15 |
# File 'lib/run_loop/cli/tcc.rb', line 11 def services RunLoop::TCC::PRIVACY_SERVICES.each do |key, _| puts key end end |