Add extra types to compressed filetype filter.

This adds a few more common compressed filetypes to the is_compressed
fuction. Notably, xz, and two common package file formats, deb and rpm.
This commit is contained in:
Christopher Vittal 2017-08-06 23:04:24 -04:00
parent 115315a03c
commit 1bce51c9c8
6 changed files with 18 additions and 2 deletions

3
Vagrantfile vendored
View File

@ -168,6 +168,9 @@ Vagrant.configure(2) do |config|
touch "#{test_dir}/file-names-exts/COMPRESSED.ZIP"
touch "#{test_dir}/file-names-exts/compressed.tar.gz"
touch "#{test_dir}/file-names-exts/compressed.tgz"
touch "#{test_dir}/file-names-exts/compressed.tar.xz"
touch "#{test_dir}/file-names-exts/compressed.txz"
touch "#{test_dir}/file-names-exts/compressed.deb"
touch "#{test_dir}/file-names-exts/backup~"
touch "#{test_dir}/file-names-exts/#SAVEFILE#"

View File

@ -69,8 +69,9 @@ impl FileExtensions {
pub fn is_compressed(&self, file: &File) -> bool {
file.extension_is_one_of( &[
"zip", "tar", "Z", "gz", "bz2", "a", "ar", "7z",
"iso", "dmg", "tc", "rar", "par", "tgz",
"zip", "tar", "Z", "z", "gz", "bz2", "a", "ar", "7z",
"iso", "dmg", "tc", "rar", "par", "tgz", "xz", "txz",
"lzma", "deb", "rpm"
])
}

View File

@ -4,8 +4,11 @@
compiled.coffee
compiled.js
compiled.o
compressed.deb
compressed.tar.gz
compressed.tar.xz
compressed.tgz
compressed.txz
COMPRESSED.ZIP
crypto.asc
crypto.signature

View File

@ -10,8 +10,11 @@
compiled.coffee
compiled.js
compiled.o
compressed.deb
compressed.tar.gz
compressed.tar.xz
compressed.tgz
compressed.txz
crypto.asc
crypto.signature
document.pdf

View File

@ -5,6 +5,7 @@
VIDEO.AVI
compiled.class
compiled.coffee
compressed.deb
lossless.flac
compressed.tar.gz
compiled.js
@ -17,7 +18,9 @@ compiled.coffee
image.svg
compressed.tgz
file.tmp
compressed.txz
lossless.wav
video.wmv
DOCUMENT.XLSX
compressed.tar.xz
COMPRESSED.ZIP

View File

@ -5,6 +5,7 @@
VIDEO.AVI
compiled.class
compiled.coffee
compressed.deb
lossless.flac
compressed.tar.gz
compiled.js
@ -17,7 +18,9 @@ compiled.coffee
image.svg
compressed.tgz
file.tmp
compressed.txz
lossless.wav
video.wmv
DOCUMENT.XLSX
compressed.tar.xz
COMPRESSED.ZIP