Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace versionomy with semver2 for parsing version numbers according to semver 2.0.0 #189

Open
barrymw opened this issue Nov 13, 2018 · 0 comments

Comments

@barrymw
Copy link

barrymw commented Nov 13, 2018

As per a pull request for pact_broker, versionomy doesn't support valid semver 2.0.0 definitions.

We are building puppet modules with Jenkins and including build numbers and git hashes in order to track where a puppet module version was created from. Versionomy only supports x.y.z formats and not something like: x.y.z-pre.build_number.githash.

I will fork and create a pull request, but the basic code is:

            require 'semver'
            current = ::SemVer.parse(return_hash[:current_version], '%M.%m.%p%s%d')
            latest = ::SemVer.parse(return_hash[:latest_version], '%M.%m.%p%s%d')
            if current.major < latest.major
              return_hash[:out_of_date] = "Major".red
            elsif current.minor < latest.minor
              return_hash[:out_of_date] = "Minor".yellow
            elsif current.patch < latest.patch
              return_hash[:out_of_date] = "Patch".green
            elsif current.special < latest.special
              return_hash[:out_of_date] = "Special".green
            else
              return_hash[:out_of_date] = "No".green
            end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant