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
135
136
137
138
139
140
141
142
143
|
# File 'lib/whisper/model/uri.rb', line 135
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
145
146
147
148
|
# File 'lib/whisper/model/uri.rb', line 145
def clear_cache
super
unzipped_path.rmtree if unzipped_path.exist?
end
|