public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Search Repo:
Improve documentation of session persist/finalize exception callbacks.
Michael S. Klishin (author)
Sun May 11 14:16:42 -0700 2008
commit  f8df510045587cd49a78851c1c6fc17a0e333a7d
tree    5e503adc9db174d7fd3853da3379e0ad502ab247
parent  1a01f84b098a8936a123e2fcf91a5cd219a2e35c
...
322
323
324
 
 
 
325
326
327
...
322
323
324
325
326
327
328
329
330
0
@@ -322,6 +322,9 @@
0
     # :session_id_key<String>:: session identifier,
0
     # default is _session_id
0
     #
0
+ # :session_store<String>:: session store to use (one of cookies,
0
+ # memcache or memory)
0
+ #
0
     # :log_delimiter<String>:: what Merb logger uses as delimiter
0
     # between message sections, default is " ~ "
0
     #
...
16
17
18
19
 
20
21
22
...
83
84
85
 
 
 
 
86
87
88
89
90
...
117
118
119
120
121
122
123
124
 
 
 
 
 
125
126
127
128
129
130
 
 
 
 
131
132
133
 
 
134
135
136
137
...
138
139
140
141
 
142
143
144
145
 
146
147
148
149
150
...
151
152
153
154
155
 
 
156
157
158
159
160
161
162
163
 
 
164
165
 
166
167
168
...
16
17
18
 
19
20
21
22
...
83
84
85
86
87
88
89
90
91
92
93
94
...
121
122
123
 
 
 
 
 
124
125
126
127
128
129
130
 
 
 
 
131
132
133
134
135
 
 
136
137
138
139
140
141
...
142
143
144
 
145
146
147
148
 
149
150
151
152
153
154
...
155
156
157
 
 
158
159
160
161
162
163
164
165
 
 
166
167
168
 
169
170
171
172
0
@@ -16,7 +16,7 @@
0
 
0
     # Finalizes the session by storing the session ID in a cookie, if the
0
     # session has changed.
0
- def finalize_session
0
+ def finalize_session
0
       if @_fingerprint != Marshal.dump(request.session.data).hash
0
         begin
0
           CACHE.set("session:#{request.session.session_id}", request.session.data)
0
@@ -83,6 +83,10 @@
0
       # Array::
0
       # A pair consisting of a MemCacheSession and the session's ID. If no
0
       # sessions matched session_id, a new MemCacheSession will be generated.
0
+ #
0
+ # ==== Notes
0
+ # If there are persiste exceptions callbacks to execute, they all get executed
0
+ # when Memcache library raises an exception.
0
       def persist(session_id)
0
         unless session_id.blank?
0
           begin
0
0
0
@@ -117,20 +121,20 @@
0
     end
0
 
0
     # Regenerate the session ID.
0
- def regenerate
0
- @session_id = Merb::SessionMixin::rand_uuid
0
- self.needs_new_cookie=true
0
- end
0
-
0
+ def regenerate
0
+ @session_id = Merb::SessionMixin::rand_uuid
0
+ self.needs_new_cookie=true
0
+ end
0
+
0
     # Recreates the cookie with the default expiration time. Useful during log
0
     # in for pushing back the expiration date.
0
- def refresh_expiration
0
- self.needs_new_cookie=true
0
- end
0
-
0
+ def refresh_expiration
0
+ self.needs_new_cookie=true
0
+ end
0
+
0
     # Deletes the session by emptying stored data.
0
- def delete
0
- @data = {}
0
+ def delete
0
+ @data = {}
0
     end
0
 
0
     # ==== Returns
0
0
@@ -138,11 +142,11 @@
0
     def loaded?
0
       !! @data
0
     end
0
-
0
+
0
     # ==== Parameters
0
     # k<~to_s>:: The key of the session parameter to set.
0
     # v<~to_s>:: The value of the session parameter to set.
0
- def []=(k, v)
0
+ def []=(k, v)
0
       @data[k] = v
0
     end
0
 
0
0
0
@@ -151,18 +155,18 @@
0
     #
0
     # ==== Returns
0
     # String:: The value of the session parameter.
0
- def [](k)
0
- @data[k]
0
+ def [](k)
0
+ @data[k]
0
     end
0
 
0
     # Yields the session data to an each block.
0
     #
0
     # ==== Parameter
0
     # &b:: The block to pass to each.
0
- def each(&b)
0
- @data.each(&b)
0
+ def each(&b)
0
+ @data.each(&b)
0
     end
0
-
0
+
0
     private
0
 
0
     # Attempts to redirect any messages to the data object.

Comments

    No one has commented yet.