lib/imw/compressed_files.rb in imw-0.2.6 vs lib/imw/compressed_files.rb in imw-0.2.7

- old
+ new

@@ -8,13 +8,13 @@ # Handlers which include modules for compressed file formats as # well as the IMW::CompressedFiles::Compressible module for # compressing regular files. HANDLERS = [ - ["CompressedFiles::Compressible", Proc.new { |r| r.is_local? && r.is_file? && r.path != /\.(bz2|gz|tgz|tbz2)$/ } ], - ["CompressedFiles::Gz", Proc.new { |r| r.is_local? && r.path =~ /\.gz$/ && r.path !~ /\.tar\.gz$/ && r.path !~ /\.tgz$/ } ], - ["CompressedFiles::Bz2", Proc.new { |r| r.is_local? && r.path =~ /\.bz2$/ && r.path !~ /\.tar\.bz2$/ && r.path !~ /\.tbz2$/ } ] + ["CompressedFiles::Compressible", Proc.new { |r| r.is_local? && r.is_file? && r.path != /\.(bz2|gz|tgz|tbz2)$/i } ], + ["CompressedFiles::Gz", Proc.new { |r| r.is_local? && r.path =~ /\.gz$/i && r.path !~ /\.tar\.gz$/i && r.path !~ /\.tgz$/i } ], + ["CompressedFiles::Bz2", Proc.new { |r| r.is_local? && r.path =~ /\.bz2$/i && r.path !~ /\.tar\.bz2$/i && r.path !~ /\.tbz2$/i } ] ] # Defines methods for decompressing a compressed file. This # module isn't used to directly extend an IMW::Resource -- # instead, format specific modules (e.g. - @@ -67,16 +67,9 @@ def decompress! should_exist!("Cannot decompress.") program = compression_settings[:decompression_program] || compression_settings[:program] FileUtils.cd(dirname) { IMW.system(program, compression_settings[:decompress], path) } IMW.open(decompressed_path) - end - - # Compressed files should not return snippets. - # - # @return [nil] - def snippet - nil end # Decompress this file in its present directory, overwriting any # existing files while keeping the original compressed file. #