So, I've been writing a bunch of ruby gems recently, and one thing I would find convenient is to include the current version (as specified in the gemspec) in the rdoc
-generated documentation for my libraries, and in the OptionParser
-generated --help
sections used by my scripts (which I'm distributing via gem). Any way I can make it easy for my users to figure out which version of library/script they're currently using.
Is there any way I can access the version I specify in my gemspec from the ruby files in my lib/
or bin/
directories? That way, I don't have to update it multiple places at once - just in my gemspec.
Currently I generate my gemspecs by hand, I haven't jumped on the Rake train yet. If I can't do what I want directly with only what rubygems gives me, would rake or another tool allow me to do this?