Class: UnzipJob
- Inherits:
-
ActiveFedoraPidBasedJob
- Object
- ActiveFedoraPidBasedJob
- UnzipJob
- Defined in:
- lib/sufia/models/jobs/unzip_job.rb
Instance Attribute Summary
Attributes inherited from ActiveFedoraPidBasedJob
Instance Method Summary collapse
Methods inherited from ActiveFedoraPidBasedJob
Constructor Details
This class inherits a constructor from ActiveFedoraPidBasedJob
Instance Method Details
#queue_name ⇒ Object
2 3 4 |
# File 'lib/sufia/models/jobs/unzip_job.rb', line 2 def queue_name :unzip end |
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/sufia/models/jobs/unzip_job.rb', line 6 def run Zip::Archive.open_buffer(object.content.content) do |archive| archive.each do |f| if f.directory? create_directory(f) else create_file(f) end end end end |