How about DRYing it up a by fetching the value from the version info
supplied by your gem's specification?

http://rubygems.rubyforge.org/rubygems-update/Gem/Specification.html

On Fri, Nov 11, 2011 at 12:28 PM, Chad Perrin <code / apotheon.net> wrote:
> How do I specify and access a gem's version number within the code of the
> gem itself? =A0For example:
>
> 1. I write a library.
> 2. I write a command line utility that uses that library.
> 3. The utility uses OptionParser, with a --version option.
> 4. I package the things up inside a gem.
>
> What's the best way to specify the version number and give the code
> executed when the --version argument is supplied the ability to access
> that version number?
>
> --
> Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
>



--=20
=A0 Carina