Class: AozoraZip::CLI
- Inherits:
-
Thor
- Object
- Thor
- AozoraZip::CLI
- Defined in:
- lib/aozora_zip/cli.rb
Instance Method Summary collapse
Instance Method Details
#unzip(filename) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/aozora_zip/cli.rb', line 22 def unzip(filename) dirname = [:dir] || File.basename(filename, ".*") if ![:dir] && dirname == filename raise AozoraZip::Error, "filename #{filename} should have ext, usually `.zip`" end if [:verbose] puts "unzip #{filename} to #{dirname}" end AozoraZip::Core.unzip(filename, dirname, verbose: [:verbose], force: [:force]) end |