As a general rule of thumb, I think applications should avoid the use
of both /app and /lib directories (the Rails setup), and should
instead put all application code into well-organized /lib directories.
Always be sure your files require their direct dependencies, rather
than relying on other files doing it for them. Don't require RubyGems
unless you're sure you need to. I personally think that any code that
runs as part of your app should be under /lib, regardless of whether
it actually runs within the sinatra process or not, but a case could
likely be made that related daemons shouldn't live within the same
/lib directory as your sinatra app. Config stuff makes sense being
in a /config directory. Logs should go into /log. PIDs and the like
should NOT go in the /log directory. Logs and only logs should be in
/log. PIDs should probably live somewhere under /tmp. I personally
prefer /tmp/pids, but that's open to taste. I strongly dislike
/lib/tasks and personally prefer /Rakefile + /tasks, but again, open
to taste. I like my templates to live in /templates but here too,
open to taste. Others may prefer /views or similar.
I would probably lightly discourage any attempts to formalize any of
this though, either explicitly or implicitly with the use of skeletons
or generators. I'm of the opinion that people should make their own
skeletons and find something that works for them. Everyone has
different needs for their projects, and widely distributing a
structure leads inevitably to inappropriate usage of that structure.
Bob Aman