Project

semver2

0.07
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
maintain versions as per http://semver.org
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Development

~> 10
~> 2.12.0
 Project Readme

SemVer2 3.4.x gem, following semver.org 2.0.0

Gem Version Documentation Build Status

Sponsored by qvitoo – A.I. bookkeeping.

quickstart on the command line

install it

gem install semver2

use it

# Find the .semver file and print a formatted string from this.
semver                    # => v2.3.4

# Initialize the .semver file.
semver init

# Print the tag for the current .semver file.
semver tag                # => v0.0.0

semver inc minor          # => v0.1.0
semver pre 'alpha.45'     # => v0.1.0-alpha.45
semver meta 'md5.abc123'  # => v0.1.0-alpha.45+md5.abc123
semver format "%M.%m"     # => 0.1
git tag -a `semver tag`
say 'that was easy'

quickstart for ruby

require 'semver'
v = SemVer.find
v.major                     # => "0"
v.major += 1
v.major                     # => "1"
v.prerelease = 'alpha.46'
v.metadata = 'md5.abc123'
v.format "%M.%m.%p%s%d"     # => "1.1.0-alpha.46+md5.abc123"
v.to_s                      # => "v1.1.0-alpha.46+md5.abc123"
v.save

parsing in ruby

 require 'semver'
 v = SemVer.parse 'v1.2.3-rc.56'
 v = SemVer.parse_rubygems '2.0.3.rc.2'

git integration

git config --global alias.semtag '!git tag -a $(semver tag) -m "tagging $(semver tag)"'

existing 'SemVer' class from other gem?

You can now do this:

require 'xsemver'
v = XSemVer::SemVer.find
# ...
v.save

creds