Class: Whisper::Model::ZipURI
- Inherits:
-
URI
- Object
- URI
- Whisper::Model::ZipURI
show all
- Defined in:
- lib/whisper/model/uri.rb
Instance Method Summary
collapse
Methods inherited from URI
#initialize, #to_path
Instance Method Details
#cache ⇒ Object
134
135
136
137
138
139
140
141
142
|
# File 'lib/whisper/model/uri.rb', line 134
def cache
zip_path = super
dest = unzipped_path
return if dest.exist? && dest.mtime >= zip_path.mtime
escaping dest do
system "unzip", "-q", "-d", zip_path.dirname.to_path, zip_path.to_path, exception: true
end
zip_path
end
|
#clear_cache ⇒ Object
144
145
146
147
|
# File 'lib/whisper/model/uri.rb', line 144
def clear_cache
super
unzipped_path.rmtree if unzipped_path.exist?
end
|