My wife enjoys this when I use my geek abilities to be “romantic,” so I had the idea of a ruby script to install on her Mac, which would send her quotes and small notes from me throughout the day. I already realized that I would use GeekTool to run the script in the background, and I would use growlnotify to display messages. Now I need a way to update the script from the Internet if it changes. I don’t know anything about ruby, except how to interact with the console.
I have 2 goals: 1) Have an XML message file. This should be available for updating from the Internet, but be local if it does not have a network connection. 2) Change the script itself from the Internet if I find errors or want to improve it.
Now I know that I could just manually update the script on my Mac if I wanted, but I decided that this would be a good way to find out an even more advanced ruby.
Priority 1 will be an XML file, it will be able to download a new version if it changes. What ruby things can I use to upload a file and save it in a specific place locally?
I used hpricot before, would that be a good way to go?
Note. My mac wife is a Macbook running Leopard (but maybe 10.4, not 100%).
EDIT
If anyone is interested in the first version of the script, you can find it here
ps → the first version of the script does not actually update itself, it just updates the messages.xml file and that’s it.
source share