Class: Shred::Commands::Services::LaunchctlService
- Defined in:
- lib/shred/commands/services.rb
Instance Attribute Summary collapse
-
#plist ⇒ Object
readonly
Returns the value of attribute plist.
Attributes inherited from Service
Instance Method Summary collapse
-
#initialize(sym: nil, plist: nil) ⇒ LaunchctlService
constructor
A new instance of LaunchctlService.
- #start(ctx) ⇒ Object
- #stop(ctx) ⇒ Object
Constructor Details
#initialize(sym: nil, plist: nil) ⇒ LaunchctlService
Returns a new instance of LaunchctlService.
35 36 37 38 |
# File 'lib/shred/commands/services.rb', line 35 def initialize(sym: nil, plist: nil) super(sym: sym) @plist = plist end |
Instance Attribute Details
#plist ⇒ Object (readonly)
Returns the value of attribute plist.
33 34 35 |
# File 'lib/shred/commands/services.rb', line 33 def plist @plist end |
Instance Method Details
#start(ctx) ⇒ Object
40 41 42 |
# File 'lib/shred/commands/services.rb', line 40 def start(ctx) super(ctx, "launchctl load -w -F #{plist}") end |
#stop(ctx) ⇒ Object
44 45 46 |
# File 'lib/shred/commands/services.rb', line 44 def stop(ctx) super(ctx, "launchctl unload #{plist}") end |