ffi-libarchive-binary 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ffi-libarchive-binary.rb +15 -11
- data/lib/ffi-libarchive-binary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df1e66da1e60e426ec09b2638c7769b0fc13b94d
|
4
|
+
data.tar.gz: 5ee85b0bf63b4b09f89231f8a847997372894bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1a52d02560d355792e7795c629e3a5be82b0dc8ecf2df0175d891fffd54975930df022a7be953915fc8995e6317fe79e243ecf9e64656e50e869433daf66c9b
|
7
|
+
data.tar.gz: a4546f52ed8a3076fa752a47491c28764ab82c60cbd86e2e316d90d15db4d0818ce71ab5f6a6463f1f246631ceb57001acd4b74476b7b8fe778b79fdf8d23324
|
@@ -1,25 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "ffi-libarchive-binary/version"
|
4
|
-
require "ffi"
|
5
4
|
require "pathname"
|
6
5
|
|
7
6
|
module LibarchiveBinary
|
8
7
|
class Error < StandardError; end
|
9
8
|
|
10
|
-
|
11
|
-
|
9
|
+
LIBRARY_PATH = Pathname.new(File.join(__dir__, "ffi-libarchive-binary"))
|
10
|
+
end
|
11
|
+
|
12
|
+
module Archive
|
13
|
+
module C
|
14
|
+
def self.ffi_lib(*args)
|
15
|
+
prefixed = args.map do |names|
|
16
|
+
filenames = names.is_a?(Array) ? names : [names]
|
17
|
+
with_path = filenames.map(&:to_s).map do |filename|
|
18
|
+
LibarchiveBinary::LIBRARY_PATH.join(FFI.map_library_name(filename)).to_s
|
19
|
+
end
|
12
20
|
|
13
|
-
|
14
|
-
prefixed = names.map do |name|
|
15
|
-
paths = name.is_a?(Array) ? name : [name]
|
16
|
-
paths.map { |x| LIBRARY_PATH.join(FFI::map_library_name(x)).to_s }
|
21
|
+
with_path + filenames
|
17
22
|
end
|
18
23
|
|
19
|
-
super(*
|
24
|
+
super(*prefixed)
|
20
25
|
end
|
21
26
|
end
|
22
|
-
|
23
|
-
::FFI::Library.prepend(LibraryPath)
|
24
|
-
require "ffi-libarchive"
|
25
27
|
end
|
28
|
+
|
29
|
+
require "ffi-libarchive"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-libarchive-binary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi-libarchive
|