Permalink
Browse files

Rename chapter files to reflect their title, order is kept only in th…

…e journey_to_ramaze.txt so reordering is simpler
  • Loading branch information...
1 parent cff5435 commit 4dc6bbada5b40bebb97a42add4d89472dd068007 @manveru committed Apr 2, 2009
View
0 chapter/ch05.txt → chapter/actions.txt
File renamed without changes.
View
0 chapter/ch06.txt → chapter/adapters.txt
File renamed without changes.
View
4 chapter/ch08.txt
@@ -1,4 +0,0 @@
-= Ramaze::Current
-== Some title
-
-Not much here
View
72 chapter/ch13.txt
@@ -1,72 +0,0 @@
-= Ramaze::Session
-
-Sessions are an essential part of most dynamic web applications and so Ramaze makes it very simple to use them. We will see how to use the automated sessions, handle cookies manually and change the backend where session information is stored on the serverside.
-
-== What are sessions
-
-Although I said that they are essential, some people may not yet be familiar with sessions and what use cases exist for them, so let's take a look at a simple application using sessions first.
-
-
-[source,ruby]
---------------------------------------------------------------------------------
-require 'ramaze'
-
-class MainController < Ramaze::Controller
- HELLO = {
- 'en' => "Hello, world!",
- 'de' => "Hallo Welt!",
- 'it' => "Ciao, mondo!",
- }
-
- def index
- language = HELLO.keys.sort_by{ rand }.first
- session[:language] = language
- redirect Rs(:greet)
- end
-
- def greet
- HELLO[session[:language]]
- end
-end
---------------------------------------------------------------------------------
-
-
-In this, we select a random language key that we then set in our session. The browser that hits the index action will from now on always have this language associated to it and you can see it in your controller and templates inside the session object.
-
-Now a few details on how this works exactly.
-
-
-
-On every request, as we mentioned in the chapter about Ramaze::Current already, a Session is initialized and put into `Ramaze::STATE[:session]`. This makes it possible to access the session during the whole request. The initialization will set a cookie in the current response, setting the key `_ramaze_session_id` with a unique value representing the key to the data stored on the server.
-
-Cookies are basically a part of the response headers, a simple string that is being sent back and forth during the request/response cycle. Everytime a browser sends a request it will also send the cookie in the header with it, that way we can look up which data belongs to that browser.
-
-In Ramaze this data is stored in a cache, at the time of writing the two most commonly used ones are MemcachedCache and MemoryCache.
-
-
-
-Although they may sound similar, they are quite different concepts, MemoryCache equals a Ruby Hash, it doesn't put any restrains on the kind or amount of data stored, which can become problematic for larger applications. MemcachedCache on the other hand utilizes the MemCache library to communicate with an (usually) local memcache daemon that handles caching of key/value pairs in namespaces. It allows you to control the way caching happens very well, one commonly used option is to put a limit on the overall amount of data stored. However, old data is thrown away if your application tries to cache more data than allowed.
-
-There is a third way which was contributed recently, to utilize the Sequel ORM and use a relational database for storage, which gives both control and persistence as old data is never thrown away unless explicitly ordered to do so.
-
-== Configuration
-
-A number of options lets you decide how to use sessions and their behaviour.
-
-To disable them, simply assign:
-
-[source,ruby]
---------------------------------------------------------------------------------
-Ramaze::Global.sessions = false
---------------------------------------------------------------------------------
-
-This will give you some speedup and less data being transferred between server and client, it does not affect the ability to manually set cookies in the response.
-
-To change the backend for the session cache only (as opposed to it for all caches in your Ramaze, we talk about that in the Ramaze::Cache section) do following:
-
-[source,ruby]
---------------------------------------------------------------------------------
-Ramaze::Global.cache_alternative[:sessions] = Ramaze::MemcachedCache
---------------------------------------------------------------------------------
-
-Please make sure you have the memcached server running before starting an application with this setting.
View
0 chapter/ch04.txt → chapter/configuration.txt
File renamed without changes.
View
0 chapter/ch07.txt → chapter/controllers.txt
File renamed without changes.
View
0 chapter/ch09.txt → chapter/helpers.txt
File renamed without changes.
View
0 chapter/ch10.txt → chapter/installation.txt
File renamed without changes.
View
0 chapter/ch11.txt → chapter/requests.txt
File renamed without changes.
View
0 chapter/ch12.txt → chapter/responses.txt
File renamed without changes.
View
0 chapter/ch16.txt → chapter/security.txt
File renamed without changes.
View
0 chapter/ch02.txt → chapter/sessions.txt
File renamed without changes.
View
0 chapter/ch14.txt → chapter/templating.txt
File renamed without changes.
View
0 chapter/ch15.txt → chapter/trinity.txt
File renamed without changes.
View
0 chapter/ch01.txt → chapter/tutorial_introduction.txt
File renamed without changes.
View
49 journey_to_ramaze.txt
@@ -6,50 +6,33 @@ v0.2, March 2009
include::chapter/preface.txt[tabsize=2]
-// Tutorial introduction to Ramaze
-include::chapter/ch01.txt[tabsize=2]
-
-// Sessions
-include::chapter/ch02.txt[tabsize=2]
-
-// include::chapter/ch03.txt[tabsize=2]
+// Contains links and other snippets used all over the book
+include::chapter/attributes.txt[tabsize=2]
-// Configuration
-include::chapter/ch04.txt[tabsize=2]
+include::chapter/tutorial_introduction.txt[tabsize=2]
-// Action
-include::chapter/ch05.txt[tabsize=2]
+include::chapter/sessions.txt[tabsize=2]
-// Adapters
-include::chapter/ch06.txt[tabsize=2]
+// chapters below are old content and need major rework
-// Controllers
-include::chapter/ch07.txt[tabsize=2]
+include::chapter/configuration.txt[tabsize=2]
-// include::chapter/ch08.txt[tabsize=2]
+include::chapter/actions.txt[tabsize=2]
-// Helpers
-include::chapter/ch09.txt[tabsize=2]
+include::chapter/adapters.txt[tabsize=2]
-// Installation
-include::chapter/ch10.txt[tabsize=2]
+include::chapter/controllers.txt[tabsize=2]
-// Requests
-include::chapter/ch11.txt[tabsize=2]
+include::chapter/helpers.txt[tabsize=2]
-// Responses
-include::chapter/ch12.txt[tabsize=2]
+include::chapter/installation.txt[tabsize=2]
-// Sessions
-include::chapter/ch13.txt[tabsize=2]
+include::chapter/requests.txt[tabsize=2]
-// Templating
-include::chapter/ch14.txt[tabsize=2]
+include::chapter/responses.txt[tabsize=2]
-// Trinity
-include::chapter/ch15.txt[tabsize=2]
+include::chapter/security.txt[tabsize=2]
-// Security
-include::chapter/ch16.txt[tabsize=2]
+include::chapter/templating.txt[tabsize=2]
-include::chapter/attributes.txt[tabsize=2]
+include::chapter/trinity.txt[tabsize=2]

0 comments on commit 4dc6bba

Please sign in to comment.