I have a MacRuby app that is meant to be customized and distributed by other people. The app really only has a few things that can be customized, but I would like to figure out a way to package the application so that a person could run a script, specify a few configuration options, and have it set up the application configuration so that it is ready to distribute to others.
For example, I have a string that points to a URL. I want someone to be able to change this URL without needing to open the project in XCode, and without having to re-build (or re-compile) so that someone on Windows or Linux could make this change.
Is this sort of thing possible? I'm new to MacRuby and Objective-C, so there may be an obvious solution to this that I am not aware of.
My Solution:
I used a plist file with the name AppConfig.plist
that looked like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>homepage</key>
<string>http://google.com</string>
</dict>
</plist>
And my App Delegate could access it like this:
config_path = NSBundle.mainBundle.pathForResource('AppConfig', ofType: 'plist')
@config = load_plist File.read(config_path)
# then access the homepage key like this: @config['homepage']