1 | # ########################################################################### |
The problem is our friend "send" and the fact that it could care less about the call to private. This cost me the better part of a night, and I guess I've never really forgiven rake for it...
Enter thor. If you haven't heard of this, take a look here and see what you think. The code is practically 100% covered by specs, and is easy to dive into...and something just feels better about defining plain old ruby methods instead of tasks.
So, in the interest of learning thor better, I took the merb sake tasks and converted them to their thor equivalents. The end result is found at http://github.com/jackdempsey/merb-thor/tree/master and once you have thor installed you should install the file with
1 | $ thor install http://github.com/jackdempsey/merb-thor/tree/master%2Fmerb.thor?raw=true --as=merb |
The --as option lets you name things nicely so in the future you can do
$ thor update merb |
to get any new stuff thats added in.
I'm happy to take comments, updates, patches, etc. Enjoy!
Update
There appears to be a small bug with namespacing of commands. For the time being, all of the commands should work if you run them inside a directory where merb.thor exists. I hope to have this fixed over the next few days, but til then, this should be a quick solution.
Update Part Deux
I've created a fork of thor in a branch you can find at: http://github.com/jackdempsey/thor/tree/constants
If you install from here thor will load all .thor files it finds in your root whether they're relevant or not. This will get around the constants issue preventing things like 'thor merb:gems:refresh' from working.
Update Part Finale
So merb-thor has grown up and become part of the merb stack. I've updated the repo to point to the new goodness, but if you're reading this you can go there directly:
http://merbunity.com/tutorials/18
Much thanks to those who've shown interest in it, sent me patches, etc, I appreciate it. I'll be working on new and exciting stuff with Thor in the future, and if you have thoughts/ideas on things like http://github.com/jackdempsey/self-deprecated let me know!
No comments:
Post a Comment