go_version 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -3
- data/ext/go-version/main.go +2 -2
- data/lib/go_version/constraint.rb +2 -2
- data/lib/go_version/wrapper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ab2fea67829122925a91e7061e0457e1809725c55342119004e827a967f164a
|
4
|
+
data.tar.gz: a52e043eb0fed2f0cf3dadff944fe7f2f66f9badff31899e1fa4c32e8ff87b90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf0b3dc991d14e620fa7295ff6b0e610647a8c697392ea77ac818cf4df263b966b923b761703df8aefb95a2b652f46ed3f3be447aae69601fdbe6a15b669a0d3
|
7
|
+
data.tar.gz: ae3b06c0e213ccb1b81082e7f4dd1545d45ae2052284903f3b2a340804878ff68b8da988c4370870f08600f19298769bed9be2b02610aaf617a66f429fbb8417
|
data/README.md
CHANGED
@@ -1,7 +1,25 @@
|
|
1
1
|
# go-version-ruby
|
2
2
|
|
3
|
-
Ruby bindings for [go-version](https://github.com/hashicorp/go-version)
|
3
|
+
Ruby bindings for [hashicorp/go-version](https://github.com/hashicorp/go-version)
|
4
4
|
|
5
|
-
###
|
5
|
+
### Why?
|
6
6
|
|
7
|
-
|
7
|
+
This can be useful when you want to match the exact behavior of go-version from a ruby app.
|
8
|
+
|
9
|
+
### Prerequisites
|
10
|
+
|
11
|
+
go 1.16+
|
12
|
+
|
13
|
+
### Installing
|
14
|
+
|
15
|
+
`gem install go_version`
|
16
|
+
|
17
|
+
### Usage
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'go_version'
|
21
|
+
|
22
|
+
constraint = GoVersion::Constraint.new("> 1.0.0")
|
23
|
+
constraint.check("1.1.0") # true
|
24
|
+
constraint.check("1.0.0") # false
|
25
|
+
```
|
data/ext/go-version/main.go
CHANGED
@@ -6,8 +6,8 @@ import (
|
|
6
6
|
"github.com/hashicorp/go-version"
|
7
7
|
)
|
8
8
|
|
9
|
-
//export
|
10
|
-
func
|
9
|
+
//export Check
|
10
|
+
func Check(constraint *C.char, ver *C.char) bool {
|
11
11
|
constraints, err := version.NewConstraint(C.GoString(constraint))
|
12
12
|
if err != nil {
|
13
13
|
return false
|
data/lib/go_version/wrapper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Croft
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- lib/go_version.rb
|
54
54
|
- lib/go_version/constraint.rb
|
55
55
|
- lib/go_version/wrapper.rb
|
56
|
-
homepage: https://
|
56
|
+
homepage: https://github.com/brandonc/go-version-ruby
|
57
57
|
licenses:
|
58
58
|
- MIT
|
59
59
|
metadata: {}
|