I am working on POC to create .cab file (MS compress format) in ruby on rails application. I found this ruby-libmspack that provide bindings to create .cab files. But the gem seriously lacks examples. I did lot of research on google but didnt find any sample code to compress files into .cab archive.
Did anyone knows how to create cab archive using ruby-libmspack gem? Is there any other way to create .cab archive in ruby on rails application?
Not Sure About Ruby-libmspack, but lcab can create CAB files on Linux.
Related
I have some .xslm files in my project which I have to edit. My application is written in Rails. I know macro enabled files can not be edited with rubyXL or roo gem, somehow I have to edit them using Ruby/Rails gems or any tool which can be incorporated within Rails app. The application is hosted on AWS, does aws have any tool to do the same ? Plus the requirement is the macros be retained.
It turns out it is not possible to edit macro enabled excel sheets (.xlsm) files in Rails. Even though you tweaked the file somehow, MS Office will treat it as a corrupt file.
I'm coming across transferring and old app to a new one, some of the reports are generated by some very old desktop app running on old xls files, the new app is build with rails 3.x but the only problem I have is that it keeps on getting an OLE Signature error, I tried parsing the files manually via excel to xlsx and all the rails xls gems start reading them. What would be the best way to handle old xls files?
Are there actually gems that read very old xls files, I've already tested roo, spreadsheet, rubyXL (i can't get simple-spreadsheet to work due to version conflicts with roo-xls and spreadsheet requirements)
Gem that would allow me to simply re-parse the file as an xlsx file and let the latest gems read them from there on.
Take a look at this gem https://github.com/roo-rb/roo-xls.
Taken from README.
This library extends Roo to add support for handling class Excel files, including:
.xls files
.xml files in the SpreadsheetML format (circa 2003)
Can someone point me to some documentation/libraries for working with files in a Rails app?
Specifically I need to scan folders for files and for each one read & parse some data from it. I've not done this in Ruby before so not sure where to look.
Thanks!
Parsing files is very easy in Ruby. To do it in Rails, you simply use the Ruby file libraries. Without knowing what you want to do I can't give you any examples, but I can point you to the Ruby API.
File: http://www.ruby-doc.org/core-1.9.3/File.html
Directory: http://www.ruby-doc.org/core-1.9.3/Dir.html
Hi I am looking for a very good solution to upload and download document file types directly to and from the database using rails 3.1.x ... I used paperclip for that but image-magick is pain to install on windows..please help me in these... Thanks
If you're not uploading images, you don't need to install image-magick.
As for storing to the database using Paperclip, see this topic.
I have a bunch of files in a directory. I want to zip some of them together into a zip archive.
I can see there are various solutions for doing so. I could use a gem such as rubyzip or run exec and just use a command line tool.
This is going to impact an important part of the system I'm working on so I'd love to have some feedback and/or directions on creating zip files with Rails.
rubyzip is a good choice. I Have used it to zip attachments in private messaging in a social app that i worked on before. However, if the files you are zipping are of big sizes, then you are advised to do some background processing using delayed_job for example.
If you are only zipping the files and not doing anything else then I would suggest using exec or system or %x to do the zipping because installing and using a gem for such a minor task doesn't make much sense.
However, if you want to do more than just zipping some directory and utilize other functionality that the gem offers then the obvious choice would be to use the rubyzip gem.
if gzip is an option, I recommend Gzip embedded in ActiveSupport