I am currently learning Ruby on Rails1. Instead of diving right into Rails, I decided to learn the fundamentals of Ruby first by reading The Ruby Programming Language from O’Reilly2. Doing a bit of comparison shopping showed that purchasing the book as an iOS app3 was the best deal at $6.99.
I downloaded the app and started reading and this is what I saw:

Umm…completely unacceptable for a programming book. Since the app uses Stanza underneath the hood, I decided to crack open the package4 to see what’s going on.
mkdir ~/ruby_book cp ~/Music/iTunes/"iTunes Media/Mobile Applications/Prog Lang 1.0.ipa" ~/ruby_book cd ruby_book unzip "Prog Lang 1.0.ipa"
Digging around revealed the Open Publication Structure5. Some Googling quickly led me to Bob DuCharme’s blog entry6 about the proper way to create an EPUB file.
cd "Payload/Prog Lang.app/book/" zip -q0X "The Ruby Programming Language.epub" mimetype zip -qXr9D "The Ruby Programming Language.epub" *
Voilà, our very own EPUB book that can be viewed using iBooks:

-
http://itunes.apple.com/us/app/the-ruby-programming-language/id327742973?mt=8 ↩
-
In iTunes, right click the app and Show in Finder to find the path of the app package. ↩
-
http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1 ↩
-
http://www.snee.com/bobdc.blog/2008/03/creating-epub-files.html ↩
-
mintyfresh posted this