Has anyone used both:
Boson: http://tagaholic.me/2009/10/14/boson-command-your-ruby-universe.html
and
Thor: http://github.com/wycats/thor
Thor are very popular and have more followers and contributers than Boson, but Boson looks far more powerful than Thor and the architecture is very well thought out.
In Boson you:
- can add methods that are used both in the console and ruby environment. So you don't have to both have Thorfiles for console and gems for ruby.
- can have aliases.
- don't have to install your script files, you just put them in ~/.boson/commands. I always have to struggle with uninstalling and installing Thorfiles after each update (which could be every minute when editing the source code, very frustrating).
- have much nicer commands output than thor.
- don't have to write the argument descriptions by hand like in Thor.
- work with modules, which are better than with classes cause you can include modules inside other modules.
- wrap open source snippets (eg. from Gist) inside a module automatically and it works with Boson immediately.
- have different views for your method results.
- don't have to recode anything in your snippets to fit Thor, since it only use native ruby code (modules). That means if you one day don't want to use Boson, you don't have to recode everything, which you have to if you are using Thor.
- The API http://rdoc.info/github/cldwalker/boson is more well documented - like tutorials inside each class.
- You can just include the "boson" modules inside your ruby script and use them directly, something I cannot with Thor, cause it is only for Thor. You can't share the Thor methods with other Thor classes (not as mixins)
I noticed all these benefits just from reading the documentation and played with Boson for a couple of minutes.
Should I use Thor just because it's more popular (cause I can't find anything else where it shines over boson) or should I take the risk that Boson may be unmaintained after a while, since the author is the only contributor?
Although it's just one guy you see how he has managed to code in a rapid speed and with outstanding quality. Would be great if more contributers like him contributed to that library. I really hope more rubyists are going to use it cause it has a lot of potential for being THE scripting framework for all system automation. Like a Rails for the backend. And the author really helps you out very fast when you file an issue.
Thor only works for the shell (which I guess is its purpose) while boson as I see it has 3 main functionalities. It allows you to have code working in the shell, in ruby (irb and scripts) and you can have nice collections of all your Ruby codes, without modifications.
I have always wanted a framework to be my backend scripting framework, and now I don't have to reinvent the wheel. It seems that boson could be it.
Has someone used both these libraries and could share some thoughts?