Skip to content

rubyworks/versus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homepage / Report Issue / Source Code ( Build Status )

A Best-of-Breed Version Class Library

The Versus gem is a best-of-breed version number class library, providing classes for a variety of version related requirements.

Version Number

The primary class of the Versus gem is the Version::Number class. It does exactly what one would expect, by taking a version literal and giving it a versitle interface to query and manipulate.

    v = Version::Number.new('1.2.0')
    v.major  #=> 1
    v.minor  #=> 2
    v.patch  #=> 0

The constructor can also take a tuple and #[] is provided as a convenient alias.

    v = Version::Number[1,2,0]

The Version::Number class has a number of useful methods, such as #satisfy.

    v.satisfy?("> 1.0")

Version Constraint

Versus also provides a standalone constraint class.

    c = Version::Constraint.new("~> 1.2.0")

Then versions can be tested against the constraint.

    c.satisfy?("1.2.1")

Version Resolver

The Version::Resolver class is a powerful tool for taking a set of interdpendent named version requirements and resolving them for the best solution.

Version File

A Version::File class is provided to reading and parsing the typical project VERSION file.

Versus uses QED to provided tested demonstrations. This provides a end-user acceptance testing while also providing very readable documentation.

For API documentation checkout the YARD generated docs at RubyDoc.Info.

Versus is copyrighted open source software.

Copyright 2011 Rubyworks

Versus can be modified and redistributed in accordance with the BSD-2-Clause License.

About

Best-of-Breed Version Class Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages