A New Year, a New Dancecard
Jan 10, 2014 / By Yanick Champoux
First things first: Happy New Year y’all! Health, happiness, and all that jazz to each and everyone of youses!
So the Holidays are over — or almost over, if you are one of the few lucky souls. Which means that we have to get back into the saddle. Considering that, ahem, some of us have just fallen off the grid and into the eggnog for the last two weeks, that’s easier said than done. In order to jog those hacking muscles back into shape, I decided to revisit an idea that I outlined in the Holidays of 2012: dancecard.
For the 2014 edition of this dancecard, I decided to take a slightly different approach. Instead of keeping a repository of the libraries locally, I wanted to be even lazier and simply have a main registry that would point to the download location or the git repository of the libraries.
For the moment I won’t go into the details of the code. Mostly because I pretty much banged the keyboard like a semi-hangover monkey for the last 2 hours, and it reflects in the quality of the codebase. Let it just be said that the git repo is at the usual place, and that I used MooseX::App to build the app.
So, what did those few hours of hacking gave me? Well, with the config file
~/.dancecard/config.yaml, which looks like:
--- browser_command: firefox %s libs: backbone: location: http://backbonejs.org/backbone.js website: http://backbonejs.org documentation: http://backbonejs.org dependencies: - underscore underscore: location: http://underscorejs.org/underscore.js website: http://underscorejs.org documentation: http://underscorejs.org ...
I can now get a list of all libraries I have at my disposal:
$ dancecard list INSTALLED LIBS no lib installed AVAILABLE LIBS underscore bootstrap backbone slippy font-awesome
Of course, I can also install any of those. And… look Ma: dependencies are handled automatically!
$ dancecard install backbone backbone installed underscore installed
Something I also often do is peruse the online documentation of those libraries. Noticed those “documentation” urls in the yaml registry? It’s there so that I can do,
$ dancecard doc bacbone
and have the documentation page opened automatically in Firefox. Or, for maximum laziness, I can also do,
$ dancecard doc --installed
which will open the documentation URL of every library found in the current project.
If anyone shows interest in the thing, I’ll bundle the app for CPAN consumption. As for features, things that I’ll probably tackle for my own use are:
- Tags (no software is true software without tags nowadays);
- Virtual libraries (just as a mean to install a group of libraries in a single go);
- Fish completion (I wuv the fish shell);
- Cached local documentation (’cause hitting the ‘Net each time I look for a piece of documentation fills me with guilt);
- An online main registry of libraries;
- And whatever else I may think of.
Leave a Reply