Project

go_version

0.0
The project is in a healthy, maintained state
Wraps native go-version in a ruby library for deep compatibility.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 5.24
~> 13.2

Runtime

~> 1.15
 Project Readme

go-version-ruby

Ruby bindings for hashicorp/go-version. Versions correspond to underlying go-version release versions.

Why?

This can be useful when you want to match the exact behavior of go-version from a ruby app.

Prerequisites

  • go 1.22

You need go to build the native extension for this gem. Download and install go 1.22+ before installing this gem.

Installing

gem install go_version

Usage

  1. Using a constraint to check individual versions
require 'go_version'

constraint = GoVersion::Constraint.new("> 1.0.0")
constraint.check("1.1.0") # true
constraint.check("1.0.0") # false
  1. Checking if a version string is valid
GoVersion.valid?("1.1.0") # true
  1. Compare two versions
GoVersion.compare("1.2.0", "1.2.1") # -1

Development

run make build, then rake test