Wanting to have easy access to all the documentation for my installed gems i decided to setup a startup item for the gem server that comes with RubyGems.
Come to find out the process is incredibly simple. First create a shell script to star the server:
#!/bin/sh /usr/bin/gem server --daemon
Then create a plist file describing the startup item:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> <plist version="0.9"> <dict> <key>Description</key> <string>Ruby Gems Server</string> <key>OrderPreference</key> <string>Late</string> <key>Provides</key> <array> <string>RDoc Server</string> </array> </dict> </plist> |
Create a folder, i named mine GemServer, and name the shell script the same. Put the script and the plist into this directory and copy it to /Library/StartupItems (you may have to create this).
Or, you could just download the startup item and extract it to /Library/StartupItems.
Restart and point your browser to localhost:8808 and peruse your documentation ’til your heart’s content.
I did mine like this (as root):
echo “/opt/local/bin/gem server –daemon” >> /etc/rc.local