class PleaseRun::Platform::Launchd

The platform implementation for Apple's launchd.

OS X users, this is for you!

Public Instance Methods

daemons_path() click to toggle source

Returns the file path to write this launchd config

# File lib/pleaserun/platform/launchd.rb, line 9
def daemons_path
  # Quoting launchctl(1):
  #    "/Library/LaunchDaemons         System wide daemons provided by the administrator."
  return safe_filename("/Library/LaunchDaemons/{{ name }}.plist")
end
files() click to toggle source
# File lib/pleaserun/platform/launchd.rb, line 15
def files
  return Enumerator::Generator.new do |out|
    out.yield(daemons_path, render_template("program.plist"))
  end
end
install_actions() click to toggle source
# File lib/pleaserun/platform/launchd.rb, line 21
def install_actions
  return ["launchctl load #{daemons_path}"]
end
xml_args() click to toggle source
# File lib/pleaserun/platform/launchd.rb, line 25
def xml_args
  return if args.nil?
  return args.collect { |a| "<string>#{a}</string>" }.join("\n        ")
end