Class: Aozora2Html::Zip

Inherits:
Object
  • Object
show all
Defined in:
lib/aozora2html/zip.rb

Class Method Summary collapse

Class Method Details

.unzip(zipfilename, textfilename) ⇒ Object



4
5
6
7
8
9
# File 'lib/aozora2html/zip.rb', line 4

def self.unzip(zipfilename, textfilename)
  ::Zip::File.open(zipfilename) do |zip_file|
    entry = zip_file.glob('*.txt').first
    entry.extract(textfilename)
  end
end