go_version 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +7 -0
- data/ext/go-version/extconf.rb +22 -0
- data/ext/go-version/go.mod +6 -0
- data/ext/go-version/go.sum +2 -0
- data/ext/go-version/main.go +24 -0
- data/lib/go_version/constraint.rb +11 -0
- data/lib/go_version/wrapper.rb +10 -0
- data/lib/go_version.rb +2 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f82286c5a009760d278845c33a57be46deed12a1fe7956b2bd0d9e16c1d8f292
|
4
|
+
data.tar.gz: 238dda82d020c48e4fad75ea4cfd6e79d403f5c86f112e162b5961d9deaf8a45
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 238ad24c3b8a2aa7d7cd6e484042993bc294afd9a8d3ca03e2e38b1e28b8fc2a9f4adb3aa7588c07d2281aa34f4809170f779aa3e6c866e63ceed3ce23f1b8cb
|
7
|
+
data.tar.gz: 1f76a0c54ff2fdffee9b63a45f6108141775af546425ca936f2517a298d264c0bf3d69bed01f9eb92a4862510eaecae353e8fcf908ffdcbeb6ef557099bbc366
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "mkmf"
|
2
|
+
|
3
|
+
find_executable("go")
|
4
|
+
|
5
|
+
$objs = []
|
6
|
+
def $objs.empty?; false; end
|
7
|
+
|
8
|
+
create_makefile("go_version/go_version")
|
9
|
+
|
10
|
+
case `#{CONFIG["CC"]} --version`
|
11
|
+
when /Free Software Foundation/
|
12
|
+
ldflags = '-W1,--unresolved-symbols=ignore-all'
|
13
|
+
when /clang/
|
14
|
+
ldflags = '-undefined dynamic_lookup'
|
15
|
+
end
|
16
|
+
|
17
|
+
File.open("Makefile", "a") do |f|
|
18
|
+
f.write <<-EOS.gsub(/^ {8}/, "\t")
|
19
|
+
$(DLLIB):
|
20
|
+
CGO_CFLAGS='$(INCFLAGS)' CGO_LDFLAGS='#{ldflags}' go build -buildmode=c-shared -o $(DLLIB) .
|
21
|
+
EOS
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
package main
|
2
|
+
|
3
|
+
import (
|
4
|
+
"C"
|
5
|
+
|
6
|
+
"github.com/hashicorp/go-version"
|
7
|
+
)
|
8
|
+
|
9
|
+
//export Satisfies
|
10
|
+
func Satisfies(constraint *C.char, ver *C.char) bool {
|
11
|
+
constraints, err := version.NewConstraint(C.GoString(constraint))
|
12
|
+
if err != nil {
|
13
|
+
return false
|
14
|
+
}
|
15
|
+
|
16
|
+
checkVersion, err := version.NewVersion(C.GoString(ver))
|
17
|
+
if err != nil {
|
18
|
+
return false
|
19
|
+
}
|
20
|
+
|
21
|
+
return constraints.Check(checkVersion)
|
22
|
+
}
|
23
|
+
|
24
|
+
func main() {}
|
data/lib/go_version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: go_version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brandon Croft
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ffi
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake-compiler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
41
|
+
description: wraps native go-version in a ruby library for certain compatibility
|
42
|
+
email: bcroft@hashicorp.com
|
43
|
+
executables: []
|
44
|
+
extensions:
|
45
|
+
- ext/go-version/extconf.rb
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- README.md
|
49
|
+
- ext/go-version/extconf.rb
|
50
|
+
- ext/go-version/go.mod
|
51
|
+
- ext/go-version/go.sum
|
52
|
+
- ext/go-version/main.go
|
53
|
+
- lib/go_version.rb
|
54
|
+
- lib/go_version/constraint.rb
|
55
|
+
- lib/go_version/wrapper.rb
|
56
|
+
homepage: https://rubygems.org/gems/go_version
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubygems_version: 3.1.6
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: ruby bindings for the hashicorp/go-version lib
|
79
|
+
test_files: []
|