ffi-libarchive 1.0.4 → 1.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8c73cb018db4e1227aa66b0f895999e2526c44b06c240a8be6457302d4d7e54
4
- data.tar.gz: 86d0b798be119ea9884267662eb24103af23e7ed5a0ff407eb260b2e42a5216d
3
+ metadata.gz: 27c509a1d26618d51623cca95acc84cfeb8c804bdf818b999c8d10ac173a99ae
4
+ data.tar.gz: 7d2a2184aa944ff1e91917be83e58be06d1df592154ce1a1bc33c8c1a6e1dd5e
5
5
  SHA512:
6
- metadata.gz: 727b4d399308d3f18e23909698bf8f8a456f916c71ac2ae13fa7baf7915b707959f7be977a1192ab5707a2ded62b4a8e0edf6812510d90c580e778e81610ee4d
7
- data.tar.gz: 87beb19eba6dcee8f0a15ec412175e246ecf13533a1adee1f2419b99abfc0b44eb22aecbfb382b88f23ffe19f463272a2261bd56211f801eb8a2acacc6c2d41d
6
+ metadata.gz: e6ba3e6ccb7c1ce9656a6bf399e4d6050bf9b8bc813d4eb6f9435c0be177dda9c861d9387913e8220eb7e27067ce93cbd891f221efcdc62c11e61f0b9284b055
7
+ data.tar.gz: 84bec17cb6e83978bd5241c116668ade6e4b2cf25595bdd44f10267c8274f42eaec00ec9719ecec2020cc1d927c13d55c437de89f4b5a8c387ed1ee1083b3797
@@ -1,6 +1,6 @@
1
1
  module Archive
2
2
  # :stopdoc:
3
- LIBPATH ||= ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
3
+ LIBPATH ||= __dir__ + ::File::SEPARATOR
4
4
  PATH ||= ::File.dirname(LIBPATH) + ::File::SEPARATOR
5
5
  # :startdoc:
6
6
 
@@ -97,9 +97,16 @@ module Archive
97
97
  raise
98
98
  end
99
99
 
100
- def extract(entry, flags = 0)
100
+ def extract(entry, flags = 0, destination: nil)
101
101
  raise ArgumentError, "Expected Archive::Entry as first argument" unless entry.is_a? Entry
102
102
  raise ArgumentError, "Expected Integer as second argument" unless flags.is_a? Integer
103
+ raise ArgumentError, "Expected String as destination" if destination && !destination.is_a?(String)
104
+
105
+ if destination
106
+ # We update the pathname here so this will change for the caller as a side effect, but this seems convenient and accurate?
107
+ pathname = C.archive_entry_pathname(entry.entry)
108
+ C.archive_entry_set_pathname(entry.entry, "#{destination}/#{pathname}")
109
+ end
103
110
 
104
111
  flags |= EXTRACT_FFLAGS
105
112
  raise Error, @archive if C.archive_read_extract(archive, entry.entry, flags) != C::OK
@@ -1,3 +1,3 @@
1
1
  module Archive
2
- VERSION = "1.0.4".freeze
2
+ VERSION = "1.0.17".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-libarchive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bellone
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-08-13 00:00:00.000000000 Z
13
+ date: 2021-02-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.0.3
79
+ rubygems_version: 3.1.4
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: A Ruby FFI binding to libarchive.