Project

versionary

0.0
No commit activity in last 3 years
No release in over 3 years
Versionary has a simple VersionNumber object that allows you to do things like `raise "Not the right version" unless VersionNumber.of( RUBY_VERSION ) >= '1.9.2'`
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 0.8.7
>= 2.5.0
 Project Readme

Versionary - a simple gem that allows you to compare version numbers

This was extracted from the RiverGlide ruby template project

Synopsis

A simple, comparable, rational, version number object.

Allows you to do things like this:

raise "not the right version" unless VersionNumber.of( RUBY_VERSION ) >= VersionNumber.of( '1.9'2' )
raise "not the right version" unless VersionNumber.of( RUBY_VERSION ) >= '1.9.2'

Or any other comparison between any VersionNumber you create:

VersionNumber.of( '0.9.10' ) > '0.9.9'
VersionNumber.of( '0.9.9' ) < '0.9.10'
VersionNumber.of( '0.9.10' ) >= '0.9.9'
VersionNumber.of( '0.9.10' ) == '0.9.10'

As you can see, it does a numerical (rather than alphabetical) comparison of the major, minor and build numbers.

It doesn't do version bumping or anything like that - but if you want to to, fork it, branch, add that ability and send us a pull request :-)

Usage

If you're using bundler, reference the gem in your Gemfile or gemspec as a runtime dependency and bundler will do the rest... Or, gem install versionary and then:

require 'versionary/version_number'