I've settled on the following workflow, which has made writing and maintaining multiple BugMonkey customizations much easier:
1. While I'm refining a new BugMonkey script:
- Create a Dropbox account (if you don't already have one)
- Add a "bugmonkey" folder to the "Public" folder in your main Dropbox folder
- Add a new JavaScript and CSS file to the bugmonkey folder (e.g.,
[path to dropbox]/Public/bugmonkey/foo.js and [path to dropbox]/Public/bugmonkey/foo.css). These files will hold the JavaScript and CSS for your new customization.
- Copy the public URL for these new files (Right-click on foo.js/foo.css -> Dropbox -> Copy public link)
- Paste those URLs into the following customization template:
`
name: DEBUG: My awesome new customization
description: Makes unicorn tears rain from the sky
author: Dane Bertram
version: 1.0.0.0
js:
$.getScript('https://[public dropbox url for foo.js]');
$('<link>')
.attr('type', 'text/css')
.attr('rel', 'stylesheet')
.attr('href', 'https://[public dropbox url for foo.css]')
.appendTo($('head'));
Now you can modify foo.js and foo.css using whatever editor you want on your local machine and all you have to do is save and refresh your browser to see the changes in FogBugz. And, because you're using Dropbox, you'll be able to work on your fancy new customizations from any computer you've set up with Dropbox.
What if I don't have/can't use Dropbox?
That's unfortunate, but as another (slightly more complicated) option, you can just setup a local webserver to serve files from a directory on your local machine. Once you've done that, just plunk in the URLs to files from your local-machine-website into the BugMonkey template above, and you should be good to go.
For example,
- Setup Apache or IIS to serve C:\code\bugmonkey (for example) as a website
- Put
foo.js and foo.css into C:\code\bugmonkey
- Put
http://[your local machine website]/foo.js and http://[your local machine website]/foo.css into the template above.
Once I've got the script ready to publish/share:
- Create a new public or private gist on GitHub
- Put
foo.js and foo.css into the gist
- Copy the gist's URL into my gist-backed BugMonkey template
- Give the gist-backed version of your customization a good name and enable it and then disable/delete the dropbox-backed debug version.
- Sip lemonade. :)
What does a gist-backed BugMonkey script buy me? The readme file has more details, but for starters, you get version control. And, additionally, it gives you one place to update your BugMonkey customizations regardless of how many places you're using it.
Note that you could skip the dropbox-backed step altogether and just put your new customization into a gist to begin with. And, with a little work, you could tweak the gist-backed BugMonkey template to also work with regular git repositories.