sheerun / bowered

Bower client that integrates with Sprockets
MIT License
2 stars 0 forks source link

Archive extracting service #4

Open sheerun opened 10 years ago

sheerun commented 10 years ago

It is used for github, url, and file resolvers.

Bower source: https://github.com/bower/bower/blob/master/lib/util/extract.js

Supported formats are:

'.zip': extractZip,
'.tar': extractTar,
'.tar.gz': extractTarGz,
'.tgz': extractTarGz,
'.gz': extractGz,
'application/zip': extractZip,
'application/x-zip': extractZip,
'application/x-tar': extractTar,
'application/x-tgz': extractTarGz,
'application/x-gzip': extractGz

Output of this task is:

class ArchiveExtractor
  # @param source [String] file path to archive
  # @param destination [String] the directory where to extract archive
  # @raise [BoweredError] if extraction fails 
  def call(source, destination)
  end
end

We should try to reuse other gems for sole extraction.