rbthemis 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rbthemis.rb +44 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 737ccca2cb74d04c18abe43c4aa5ee65def9cef6c0d3bcd89410c76abf12e7fa
|
4
|
+
data.tar.gz: ce08155c7d83bbda14acc0a79185b7943b1ee6d39c28a28c99b92082accf216e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a60a03fbd1947834c2cce2399f1c58ef71c1714feed534bd4cfe9f6445036eb1824bed92e60900249f89e785532d1d6233625c64b95309e19b16c27bfddb85d5
|
7
|
+
data.tar.gz: ffd1759217dab678e0554aa30566feaec18bbcc6e7b172072f1d77b101d1e95bac0d502db9d6fe971d41bd2770bf27eaddae7fb773c39265fedaf39020c7d4ff
|
data/lib/rbthemis.rb
CHANGED
@@ -32,7 +32,50 @@ end
|
|
32
32
|
|
33
33
|
module ThemisImport
|
34
34
|
extend FFI::Library
|
35
|
-
|
35
|
+
|
36
|
+
def self.canonical_themis_paths
|
37
|
+
host_os = RbConfig::CONFIG['host_os']
|
38
|
+
paths = []
|
39
|
+
if host_os.start_with? 'linux'
|
40
|
+
# Default library installation path for "make install"
|
41
|
+
paths.append '/usr/local/lib/libthemis.so.0'
|
42
|
+
# Don't bother figuring out the "right" absolute path, since
|
43
|
+
# that depends on the distro and non-distro-provided Rubies
|
44
|
+
# don't know about the right paths at all. The ones installed
|
45
|
+
# via RVM certainly don't. Use soname and let ld figure it out.
|
46
|
+
paths.append 'libthemis.so.0'
|
47
|
+
end
|
48
|
+
if host_os.start_with? 'darwin'
|
49
|
+
# Default library installation path for "make install"
|
50
|
+
paths.append '/usr/local/lib/libthemis.0.dylib'
|
51
|
+
# These are install names of libraries installed via Homebrew
|
52
|
+
# Add both M1 and Intel paths so that x86 Ruby works on M1
|
53
|
+
paths.append '/opt/homebrew/opt/libthemis/lib/libthemis.0.dylib'
|
54
|
+
paths.append '/usr/local/opt/libthemis/lib/libthemis.0.dylib'
|
55
|
+
# Last try, look for ABI-qualified name
|
56
|
+
paths.append 'libthemis.0.dylib'
|
57
|
+
end
|
58
|
+
return paths
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.load_themis
|
62
|
+
for path in canonical_themis_paths
|
63
|
+
begin
|
64
|
+
return ffi_lib path
|
65
|
+
rescue LoadError
|
66
|
+
next
|
67
|
+
end
|
68
|
+
end
|
69
|
+
warn <<~EOF
|
70
|
+
WARN: failed to load the canonical Themis Core library
|
71
|
+
|
72
|
+
Proceeding to find 'themis' library in standard paths.
|
73
|
+
This might cause ABI mismatch and crash the process.
|
74
|
+
EOF
|
75
|
+
return ffi_lib 'themis'
|
76
|
+
end
|
77
|
+
|
78
|
+
load_themis
|
36
79
|
|
37
80
|
callback :get_pub_key_by_id_type,
|
38
81
|
[:pointer, :int, :pointer, :int, :pointer], :int
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbthemis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CossackLabs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -59,8 +59,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
requirements:
|
62
|
-
- libthemis, v0.
|
63
|
-
rubygems_version: 3.
|
62
|
+
- libthemis, v0.15.0
|
63
|
+
rubygems_version: 3.3.25
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: Data security library for network communication and data storage for Ruby
|