excavate 0.3.3 → 0.3.4

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: ae1e2f6707705a5247f26db5c29f7ffb3618ccdf890277ca664cc91361e9ab7c
4
- data.tar.gz: 5ea58834d2bcbb1005a36c9f239d32f34a7e61a2bff4a4a0548cdc5e4ae38688
3
+ metadata.gz: 7a8ee881421934ef0e3333fe045b1af9d8925b93930fe2f7fd136254ff308382
4
+ data.tar.gz: 9ca82179fdc265ba891c262f95d200c73bf2376399abd106135a6dcc8e2479e5
5
5
  SHA512:
6
- metadata.gz: 38d73443fa50e9d4af01d9adcde21e45cee4c201f7bb586ce9097d37e092153d18acd5109183ba3bec3c9ecbd4a017d4f4882a44f3f1caf9e83ad98b769b8997
7
- data.tar.gz: 0c6b9f6673b571ca5f582b4b0080180b89d091cfbaa85932b642f3c9ee690433e9e0afbac4b7ad1536307c09f54f2d614dc9df1a1690cdde0e0f736ac9f3151b
6
+ metadata.gz: 85d30df5e364ea3207a28a10cdf28dbe7020bf03af32661a43d925aaf29b2413995dd7eab0184e881e06b3910098d11018e1bc22f718e82e75c277d01459e28b
7
+ data.tar.gz: bfea734b56d0e83574d97ce009555cac2130ee13c1a35e83c331579718d5619ae956adba4479c0d2748d416083be269b6e88092bb39d47ed733aa3bbadbd3c81
@@ -240,6 +240,8 @@ module Excavate
240
240
  return false unless File.file?(file)
241
241
 
242
242
  ext = normalized_extension(file)
243
+ return false if ext == "gz" && FileMagic.detect(file) != :gzip
244
+
243
245
  TYPES.key?(ext)
244
246
  end
245
247
  end
@@ -9,9 +9,15 @@ module Excavate
9
9
  end
10
10
 
11
11
  def detect
12
- case File.read(@path, 8, mode: "rb")
12
+ beginning = File.read(@path, 8, mode: "rb")
13
+ case beginning
13
14
  when "MSCF\x00\x00\x00\x00".force_encoding("BINARY")
14
15
  :cab
16
+ else
17
+ case beginning.byteslice(0, 2)
18
+ when "\x1F\x8B".force_encoding("BINARY")
19
+ :gzip
20
+ end
15
21
  end
16
22
  end
17
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Excavate
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excavate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-27 00:00:00.000000000 Z
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arr-pm
@@ -215,7 +215,7 @@ metadata:
215
215
  source_code_uri: https://github.com/fontist/excavate
216
216
  changelog_uri: https://github.com/fontist/excavate
217
217
  rubygems_mfa_required: 'false'
218
- post_install_message:
218
+ post_install_message:
219
219
  rdoc_options: []
220
220
  require_paths:
221
221
  - lib
@@ -230,8 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  requirements: []
233
- rubygems_version: 3.3.7
234
- signing_key:
233
+ rubygems_version: 3.4.10
234
+ signing_key:
235
235
  specification_version: 4
236
236
  summary: Extract nested archives with a single command.
237
237
  test_files: []