How would you display the contents of a github zip file and display the contents in a web application with the correct file structure?
Could I somehow insert the zip file into the database and then print the contents onto a webpage instead of scraping every single file?
Making the assumption that you are trying to build a view of the contents of the zipfile similar to Githubs representation, after uploading said zipfile to your server, the easiest way would be to:
To give you a simple example stub how to parse the file (e.g. named test.zip)
Zip::ZipFile.open("test.zip") do |zipfile|
zipfile.each do |entry|
# Do something with the enty / create your hash like you need it
end
end
You can find more details in the documentation.
HTH