10 January 2012

Awesome CLI gem: Commandable

Ever wanted to drive your ruby code with a CLI?  Well, the commandable gem makes it easy.

At first, I struggled with OptionParser in the stdlib, but I had to duplicate my option handling across CLI code and method invocation.  Then OptionParser didn't handle required parameters at all, requiring me to do required parameters in a non-DRY way.   Also, OptionParse doesn't do sub-commands, git-style, which I needed for the new git plugin I'm working on.

When I saw the pickled_optparse gem (from Mike Bethany), it appeared to solve the missing 'required parameter' feature.  And the subcommand gem seemed to allow for subcommands with their own options, git-style.  However, the duplication across option definition and method invocation was still present.  And even subcommand required you to hook up the command to the class/method that needed to be called.

Finally I found that the author of pickled_optparse had totally rethought CLI in ruby with his commandable gem.  And I really like what he did.

Now there is no real additional logic AT ALL in order to hook your ruby class up to the command line.  Now my option handling code will be in the place it belongs, in the code that is doing the command that I invoked from the command line.

The main awesomeness here is that commandable pushes the CLI code into the appropriate place in your ruby class -- it makes it hard to scatter CLI code all over the place.

My only beef with the gem are the following points:

  • it comes with colors enabled by default (unusual for a CLI)
  • it clears the screen by default when displaying help (when colors are enabled, very unusual and annoying for a CLI)
  • it appears to be hard to do global options like: "cmd --global subcommand [args]"
  • there is no support for parsing command CLI-style options into ruby hashes, but this is a minor nit, because that's what OptionParser is for, and it's easy to use inside the method

I fixed a problem where the screen was cleared even if you disabled colors, and I've pushed it up to my fork.

Here is my hello world that shows commandable in action:

And here's the output for a few representative cases:

04 January 2012

Open Genealogy Alliance

The manifesto posted at opengenalliance.org is something that I can very much support.

As part of RootsTech 2012, I'm going to sign up for an open hour to talk about open content licenses.  Anyone who has an interest in this topic, please get in touch with me and we can collaborate on the presentation.

I wonder what it will take to get some more visible & material signs of support from archives, libraries, societies, museums, or genealogical content companies on that site.

Something like the contributors listed on opencontentalliance.org.

Perhaps a link to the Better Than Free article is in order.  My personal resources are small, but if there is any kind of material support I can give to the opengenalliance.org effort, I want to do so.

Here are a few examples I could find of license information on open content sites (some related to genealogy, some not):

03 January 2012

Wish TwitterFeed supported auto-hashtags

After using TwitterFeed for a while, it's really cool!  Props to betaworks for an awesome tool!

All I want now is auto-hashtag support.

Just look for the last line of a post that is only hashtags, and #dont #take #arbitrary hashtags from the #body of the #post.

Don't bother with trying to convert blog post tags into hashtags -- I want a different vocabulary of hashtags on twitter vs. tags on my blog.

#twfeed #hashtags

02 January 2012

Open Geneological Research Vision

At its core, every sustained genealogical research effort turns into a global, loosely-connected, semi-structured distributed edits problem.

Open genealogical research needs a few conditions to thrive, I think.
  • significant stable corpus of research
  • everyone publishing under compatible open data licenses (CC-BY[-SA], CC0, or others)
  • agreed-upon standard data formats
  • ability to self-publish and curate your own research, independent of anyone else
  • ability to make corrections, and publish those corrections, independent of anyone else
  • ability to follow others' self-published research/corrections and pull it into your own research if you agree
  • mechanisms that encourage convergence of separate research efforts on the same research topics
Significant advances have been made in the last decade to enable certain aspects of online genealogical research.  The contributions of Ancestry and FamilySearch to providing indexed original records should not be underestimated.

The global family tree databases of Ancestry, Geni, FamilySearch, One Great Family, and others are also very significant.  The efforts of TNG and PHPgedview are especially significant in the control and latitude that they give to individual contributors in their efforts to self-publish.

However, online is not the same as open.  Open means more than just letting the general public search or get a login, it means that the dataset is licensed under an open license, and that this open licensing is adequately encouraged for subsequent contributions.

The ability for collaborative self-publishing is a primary concern that seems only partially implemented at this point in existing tools.

I have had this picture in my head for a while, and it seems the right time to start writing about it and doing something about it.

Seen, Persuaded, Embraced, Confessed

One verse in Paul's description of the fathers of faith stood out to me:
Heb. 11:13 These all died in faith, not having received the promises, but having seen them afar off, and were persuaded of them, and embraced them, and confessed that they were strangers and pilgrims on the earth.
I've watched true followers of Jesus Christ demonstrate their devotion to Him in ways that involve all four elements of conversion.  In fact, I'd be willing to take this verse as a starting point for describing what true conversion is like.

It seems to me that this pattern of increasing commitment and devotion is tightly involved in the process of understanding what one's personal mission in this life is.  When it finally gels, there isn't anything else but just to go do your life's work, and give your whole self for your Lord Jesus Christ and what He's called you to do here.