Class: Shred::Commands::Services::LaunchctlService

Inherits:
Service
  • Object
show all
Defined in:
lib/shred/commands/services.rb

Instance Attribute Summary collapse

Attributes inherited from Service

#sym

Instance Method Summary collapse

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

#plistObject (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