Skip to content

brandonc/go-version-ruby

Repository files navigation

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

About

Ruby bindings for hashicorp/go-version for deep semver compatibility

Resources

License

Stars

Watchers

Forks

close