Ruby web app lifecycle
I am interesting in some manual/tutorial which I could not find.
What is a lifecycle of Ruby Web application? Ruby is a scripting language. Same as PHP. But as I heard, Ruby is precompiled before running. So the questions are:
- when precompilation is done?
- how precompilation is working for different files and classes?
- what is a lifetime of precompiled code?
- how route is passed to ruby application from apache/nginx (example could be made based on sinatra)?
- maybe there is a tutorial on how to make own simple web framework, or web page without any web frameworks, but with pure ruby.
- where is session object located?
Every manual contains only information on how to use some framework, but how it is working internally, nothing is describing this.
Ruby is "interpreted" just as PHP is, but this is also a form of compilation. What you might be confusing is that Ruby on Rails and Sinatra, as with most Ruby-based frameworks, are hosted as persistent processes. PHP tends to be interpreted for each request, though accelerators and web server modules do reduce the overhead of this process significantly.
I wouldn't suggest trying to make your own framework as this is a non-trivial task and even as an academic exercise would be of limited value. It's best to study something like Sinatra to see how that's implemented in order to learn more than to start from scratch.
Rails is quite well documented. If you have a specific question about a component of the framework that can't be answered by simply reading the source code, which is usually fairly well organized, you can post that here.