How to create a sinatra app that can create ebooks on heroku?

Hi guys,

I’m not new to ruby or Sinatrabut I have no idea how to get epub, mobi
and pdf files using sinatra. The other problem is that I have no idea
how Heroku’s file system works, so please help me on a few things.

How do I get my Sinatra app to create epub mobi and pdf files based from
user input and allow the user to download?

How could it work with Heroku since I’m not sure how heroku can allow
users to download files?

Thanks
Kenley

On Thu, May 10, 2012 at 12:54 AM, Kenley T. [email protected]
wrote:

How do I get my Sinatra app to create epub mobi and pdf files based from
user input and allow the user to download?

google ruby gem epub mobi pdf

How could it work with Heroku since I’m not sure how heroku can allow users
to download files?

If you’re generating on the fly, no problem; if you need to store the
files, you need to use an external resource like Amazon S3.

HTH,

Hi Hassan,

Thanks for responding, but google gave me gems that require the use of
commandline tools, but I want it as a sinatra app.

Also, I have no idea how to use the tmp directory in heroku and allow
users to download files.

Thanks
Kenley


From: Hassan S. [email protected]
To: ruby-talk ML [email protected]
Sent: Thursday, May 10, 2012 9:59 PM
Subject: Re: How to create a sinatra app that can create ebooks on
heroku?

On Thu, May 10, 2012 at 12:54 AM, Kenley T. [email protected]
wrote:

How do I get my Sinatra app to create epub mobi and pdf files based from
user input and allow the user to download?

google ruby gem epub mobi pdf

How could it work with Heroku since I’m not sure how heroku can allow users
to download files?

If you’re generating on the fly, no problem; if you need to store the
files, you need to use an external resource like Amazon S3.

HTH,

On Thu, May 10, 2012 at 7:26 AM, Kenley T. [email protected] wrote:

Thanks for responding, but google gave me gems that require the use of
commandline tools, but I want it as a sinatra app.

A gem is a gem - a ruby library; the fact that a given gem provides a
command line interface is irrelevant. Or perhaps we got very different
results from the same search :slight_smile:

Also, I have no idea how to use the tmp directory in heroku and allow users
to download files.

Forget about trying to use the Heroku file system; it effectively
doesn’t
exist. Use Amazon S3 or equiv if you need to store generated files.

Hassan,

Google has customized results for each person, so could you send me
links to those gems.

Also, I don’t think I’ll store the files, but I’ll try using s3 from now
on

Thanks