An open API service indexing awesome lists of open source software.

https://github.com/youpy/ruby-launch-agent

A library to use launchd easily
https://github.com/youpy/ruby-launch-agent

Last synced: 5 days ago
JSON representation

A library to use launchd easily

Awesome Lists containing this project

README

          

= ruby-launch-agent

A library to use launchd easily

== Synopsis

require 'launch_agent'

agent = LaunchAgent::Daemon.new('ruby', '/path/to/foo.rb', 'arg1', 'arg2')

# load
agent.load

# unload
agent.unload

== CLI

% launchagent -h
Usage:
launchagent [--env=] (--daemon | --interval ) [--wdir=] [--stdout=] [--stderr=] (...)
launchagent -h | --help

Options:
-h --help Show this screen.
-v --version Show version information.
-e --env= Additional environmental variables to be set before running the job. Can specify multiple value with comma. e.g. FOO=bar,BAR=baz
-w --wdir= Specify a directory to chdir(2) to before running the job
-d --daemon Load as daemon. If it is set, --interval option is ignored
-i --interval= Causes the job to be started every N seconds
-o --stdout= Specify what file should be used for data being sent to stdout when using stdio(3)
-r --stderr= Specify what file should be used for data being sent to stderr when using stdio(3)

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 youpy. See LICENSE for details.