Class: AgentsControl::Service::Launchd
- Inherits:
-
Service
- Object
- Service
- AgentsControl::Service::Launchd
- Defined in:
- lib/agents_control/service.rb
Overview
macOS.
Instance Method Summary collapse
Instance Method Details
#install ⇒ Object
53 54 55 56 57 |
# File 'lib/agents_control/service.rb', line 53 def install write(path, plist) reload path end |
#installed? ⇒ Boolean
64 |
# File 'lib/agents_control/service.rb', line 64 def installed? = File.exist?(path) |
#path ⇒ Object
51 |
# File 'lib/agents_control/service.rb', line 51 def path = File.("~/Library/LaunchAgents/#{LABEL}.plist") |
#uninstall ⇒ Object
59 60 61 62 |
# File 'lib/agents_control/service.rb', line 59 def uninstall system("launchctl", "unload", path, out: File::NULL, err: File::NULL) if File.exist?(path) FileUtils.rm_f(path) end |