clivecrous-ramaze 0.3.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (548) hide show
  1. data/README.markdown +444 -0
  2. data/Rakefile +197 -0
  3. data/bin/ramaze +60 -0
  4. data/doc/AUTHORS +30 -0
  5. data/doc/CHANGELOG +5757 -0
  6. data/doc/COPYING +56 -0
  7. data/doc/FAQ +92 -0
  8. data/doc/GPL +339 -0
  9. data/doc/INSTALL +34 -0
  10. data/doc/LEGAL +26 -0
  11. data/doc/ProjectInfo +53 -0
  12. data/doc/TODO +29 -0
  13. data/doc/meta/announcement.txt +126 -0
  14. data/doc/meta/configuration.txt +162 -0
  15. data/doc/meta/internals.txt +278 -0
  16. data/doc/meta/users.kml +64 -0
  17. data/doc/migrate/1110_to_1111.txt +131 -0
  18. data/doc/readme_chunks/appendix.txt +10 -0
  19. data/doc/readme_chunks/examples.txt +38 -0
  20. data/doc/readme_chunks/features.txt +148 -0
  21. data/doc/readme_chunks/getting_help.txt +5 -0
  22. data/doc/readme_chunks/getting_started.txt +18 -0
  23. data/doc/readme_chunks/installing.txt +55 -0
  24. data/doc/readme_chunks/introduction.txt +18 -0
  25. data/doc/readme_chunks/principles.txt +56 -0
  26. data/doc/readme_chunks/thanks.txt +59 -0
  27. data/doc/tutorial/todolist.html +816 -0
  28. data/doc/tutorial/todolist.mkd +736 -0
  29. data/examples/auth/auth.rb +54 -0
  30. data/examples/auth/template/layout.haml +20 -0
  31. data/examples/auth/template/login.haml +16 -0
  32. data/examples/blog/README +3 -0
  33. data/examples/blog/controller/main.rb +29 -0
  34. data/examples/blog/model/entry.rb +30 -0
  35. data/examples/blog/public/styles/blog.css +132 -0
  36. data/examples/blog/spec/blog.rb +87 -0
  37. data/examples/blog/start.rb +7 -0
  38. data/examples/blog/view/edit.xhtml +17 -0
  39. data/examples/blog/view/index.xhtml +17 -0
  40. data/examples/blog/view/layout.xhtml +11 -0
  41. data/examples/blog/view/new.xhtml +16 -0
  42. data/examples/caching.rb +31 -0
  43. data/examples/chat/model/history.rb +36 -0
  44. data/examples/chat/model/message.rb +7 -0
  45. data/examples/chat/public/js/jquery.js +3436 -0
  46. data/examples/chat/start.rb +40 -0
  47. data/examples/chat/view/chat.xhtml +29 -0
  48. data/examples/chat/view/index.xhtml +6 -0
  49. data/examples/chat/view/layout.xhtml +12 -0
  50. data/examples/css.rb +37 -0
  51. data/examples/element.rb +45 -0
  52. data/examples/facebook.rb +159 -0
  53. data/examples/hello.rb +15 -0
  54. data/examples/httpdigest.rb +50 -0
  55. data/examples/identity.rb +18 -0
  56. data/examples/layout.rb +28 -0
  57. data/examples/linking.rb +29 -0
  58. data/examples/localization/start.rb +35 -0
  59. data/examples/memleak_detector.rb +32 -0
  60. data/examples/nitro_form.rb +23 -0
  61. data/examples/provide.rb +23 -0
  62. data/examples/ramaise.rb +132 -0
  63. data/examples/rammit/spec/rammit.rb +31 -0
  64. data/examples/rammit/src/controller/main.rb +3 -0
  65. data/examples/rammit/src/controller/page.rb +16 -0
  66. data/examples/rammit/src/model.rb +33 -0
  67. data/examples/rammit/start.rb +8 -0
  68. data/examples/rammit/template/index.xhtml +14 -0
  69. data/examples/rammit/template/page/view.xhtml +4 -0
  70. data/examples/rapaste/Rakefile +35 -0
  71. data/examples/rapaste/controller/paste.rb +94 -0
  72. data/examples/rapaste/model/paste.rb +55 -0
  73. data/examples/rapaste/public/css/active4d.css +114 -0
  74. data/examples/rapaste/public/css/all_hallows_eve.css +72 -0
  75. data/examples/rapaste/public/css/amy.css +147 -0
  76. data/examples/rapaste/public/css/blackboard.css +88 -0
  77. data/examples/rapaste/public/css/brilliance_black.css +605 -0
  78. data/examples/rapaste/public/css/brilliance_dull.css +599 -0
  79. data/examples/rapaste/public/css/cobalt.css +149 -0
  80. data/examples/rapaste/public/css/dawn.css +121 -0
  81. data/examples/rapaste/public/css/display.css +197 -0
  82. data/examples/rapaste/public/css/eiffel.css +121 -0
  83. data/examples/rapaste/public/css/espresso_libre.css +109 -0
  84. data/examples/rapaste/public/css/idle.css +62 -0
  85. data/examples/rapaste/public/css/iplastic.css +80 -0
  86. data/examples/rapaste/public/css/lazy.css +73 -0
  87. data/examples/rapaste/public/css/mac_classic.css +123 -0
  88. data/examples/rapaste/public/css/magicwb_amiga.css +104 -0
  89. data/examples/rapaste/public/css/pastels_on_dark.css +188 -0
  90. data/examples/rapaste/public/css/slush_poppies.css +85 -0
  91. data/examples/rapaste/public/css/spacecadet.css +51 -0
  92. data/examples/rapaste/public/css/sunburst.css +180 -0
  93. data/examples/rapaste/public/css/twilight.css +137 -0
  94. data/examples/rapaste/public/css/zenburnesque.css +91 -0
  95. data/examples/rapaste/public/js/jquery.js +11 -0
  96. data/examples/rapaste/spec/rapaste.rb +49 -0
  97. data/examples/rapaste/start.rb +24 -0
  98. data/examples/rapaste/view/copy.xhtml +10 -0
  99. data/examples/rapaste/view/index.xhtml +9 -0
  100. data/examples/rapaste/view/layout.xhtml +25 -0
  101. data/examples/rapaste/view/list.xhtml +29 -0
  102. data/examples/rapaste/view/search.xhtml +41 -0
  103. data/examples/rapaste/view/view.xhtml +37 -0
  104. data/examples/rapp.rb +45 -0
  105. data/examples/rest.rb +28 -0
  106. data/examples/sequel_form.rb +24 -0
  107. data/examples/sequel_scaffolding.rb +24 -0
  108. data/examples/simple.rb +56 -0
  109. data/examples/simple_auth.rb +23 -0
  110. data/examples/sourceview/public/coderay.css +104 -0
  111. data/examples/sourceview/public/images/file.gif +0 -0
  112. data/examples/sourceview/public/images/folder.gif +0 -0
  113. data/examples/sourceview/public/images/tv-collapsable-last.gif +0 -0
  114. data/examples/sourceview/public/images/tv-collapsable.gif +0 -0
  115. data/examples/sourceview/public/images/tv-expandable-last.gif +0 -0
  116. data/examples/sourceview/public/images/tv-expandable.gif +0 -0
  117. data/examples/sourceview/public/images/tv-item-last.gif +0 -0
  118. data/examples/sourceview/public/images/tv-item.gif +0 -0
  119. data/examples/sourceview/public/jquery.js +11 -0
  120. data/examples/sourceview/public/jquery.treeview.css +48 -0
  121. data/examples/sourceview/public/jquery.treeview.js +223 -0
  122. data/examples/sourceview/public/sourceview.js +52 -0
  123. data/examples/sourceview/sourceview.rb +77 -0
  124. data/examples/sourceview/template/index.haml +59 -0
  125. data/examples/templates/template/external.amrita +19 -0
  126. data/examples/templates/template/external.haml +22 -0
  127. data/examples/templates/template/external.liquid +28 -0
  128. data/examples/templates/template/external.mab +30 -0
  129. data/examples/templates/template/external.nag +28 -0
  130. data/examples/templates/template/external.redcloth +19 -0
  131. data/examples/templates/template/external.rem +30 -0
  132. data/examples/templates/template/external.rhtml +28 -0
  133. data/examples/templates/template/external.tenjin +28 -0
  134. data/examples/templates/template/external.xsl +57 -0
  135. data/examples/templates/template/external.zmr +28 -0
  136. data/examples/templates/template_amrita2.rb +74 -0
  137. data/examples/templates/template_erubis.rb +53 -0
  138. data/examples/templates/template_ezamar.rb +50 -0
  139. data/examples/templates/template_haml.rb +50 -0
  140. data/examples/templates/template_liquid.rb +65 -0
  141. data/examples/templates/template_markaby.rb +58 -0
  142. data/examples/templates/template_nagoro.rb +51 -0
  143. data/examples/templates/template_redcloth.rb +59 -0
  144. data/examples/templates/template_remarkably.rb +55 -0
  145. data/examples/templates/template_tenjin.rb +53 -0
  146. data/examples/templates/template_xslt.rb +49 -0
  147. data/examples/todolist/README +1 -0
  148. data/examples/todolist/public/favicon.ico +0 -0
  149. data/examples/todolist/public/js/jquery.js +1923 -0
  150. data/examples/todolist/public/ramaze.png +0 -0
  151. data/examples/todolist/spec/todolist.rb +132 -0
  152. data/examples/todolist/src/controller/main.rb +70 -0
  153. data/examples/todolist/src/element/page.rb +31 -0
  154. data/examples/todolist/src/model.rb +14 -0
  155. data/examples/todolist/start.rb +11 -0
  156. data/examples/todolist/template/index.xhtml +17 -0
  157. data/examples/todolist/template/new.xhtml +7 -0
  158. data/examples/upload/start.rb +19 -0
  159. data/examples/upload/view/index.xhtml +25 -0
  160. data/examples/whywiki/spec/whywiki.rb +58 -0
  161. data/examples/whywiki/start.rb +46 -0
  162. data/examples/whywiki/template/edit.xhtml +14 -0
  163. data/examples/whywiki/template/show.xhtml +18 -0
  164. data/examples/wikore/spec/wikore.rb +111 -0
  165. data/examples/wikore/src/controller.rb +80 -0
  166. data/examples/wikore/src/model.rb +52 -0
  167. data/examples/wikore/start.rb +9 -0
  168. data/examples/wikore/template/index.xhtml +8 -0
  169. data/examples/wiktacular/README +2 -0
  170. data/examples/wiktacular/mkd/link/2007-07-20_19-45-51.mkd +1 -0
  171. data/examples/wiktacular/mkd/link/current.mkd +1 -0
  172. data/examples/wiktacular/mkd/main/2007-07-20_16-31-33.mkd +1 -0
  173. data/examples/wiktacular/mkd/main/2007-07-20_19-21-12.mkd +1 -0
  174. data/examples/wiktacular/mkd/main/2007-07-20_19-23-10.mkd +2 -0
  175. data/examples/wiktacular/mkd/main/2007-07-20_19-45-07.mkd +2 -0
  176. data/examples/wiktacular/mkd/main/current.mkd +2 -0
  177. data/examples/wiktacular/mkd/markdown/current.mkd +3 -0
  178. data/examples/wiktacular/mkd/testing/2007-07-20_16-43-46.mkd +2 -0
  179. data/examples/wiktacular/mkd/testing/2007-07-20_19-43-50.mkd +3 -0
  180. data/examples/wiktacular/mkd/testing/2007-07-21_18-46-01.mkd +11 -0
  181. data/examples/wiktacular/mkd/testing/2007-07-21_18-46-32.mkd +13 -0
  182. data/examples/wiktacular/mkd/testing/2007-07-21_18-47-08.mkd +17 -0
  183. data/examples/wiktacular/mkd/testing/2007-07-21_18-47-54.mkd +17 -0
  184. data/examples/wiktacular/mkd/testing/current.mkd +17 -0
  185. data/examples/wiktacular/public/favicon.ico +0 -0
  186. data/examples/wiktacular/public/screen.css +72 -0
  187. data/examples/wiktacular/spec/wiktacular.rb +158 -0
  188. data/examples/wiktacular/src/controller.rb +55 -0
  189. data/examples/wiktacular/src/model.rb +102 -0
  190. data/examples/wiktacular/start.rb +8 -0
  191. data/examples/wiktacular/template/edit.xhtml +6 -0
  192. data/examples/wiktacular/template/html_layout.xhtml +27 -0
  193. data/examples/wiktacular/template/index.xhtml +9 -0
  194. data/examples/wiktacular/template/new.xhtml +6 -0
  195. data/lib/proto/controller/main.rb +22 -0
  196. data/lib/proto/public/css/ramaze_error.css +90 -0
  197. data/lib/proto/public/dispatch.fcgi +11 -0
  198. data/lib/proto/public/favicon.ico +0 -0
  199. data/lib/proto/public/js/jquery.js +3436 -0
  200. data/lib/proto/public/ramaze.png +0 -0
  201. data/lib/proto/spec/main.rb +24 -0
  202. data/lib/proto/start.rb +8 -0
  203. data/lib/proto/start.ru +16 -0
  204. data/lib/proto/view/error.xhtml +64 -0
  205. data/lib/proto/view/index.xhtml +34 -0
  206. data/lib/proto/view/page.xhtml +27 -0
  207. data/lib/ramaze.rb +108 -0
  208. data/lib/ramaze/action.rb +153 -0
  209. data/lib/ramaze/action/render.rb +191 -0
  210. data/lib/ramaze/adapter.rb +101 -0
  211. data/lib/ramaze/adapter/base.rb +103 -0
  212. data/lib/ramaze/adapter/cgi.rb +24 -0
  213. data/lib/ramaze/adapter/ebb.rb +22 -0
  214. data/lib/ramaze/adapter/evented_mongrel.rb +7 -0
  215. data/lib/ramaze/adapter/fcgi.rb +24 -0
  216. data/lib/ramaze/adapter/lsws.rb +23 -0
  217. data/lib/ramaze/adapter/mongrel.rb +25 -0
  218. data/lib/ramaze/adapter/scgi.rb +22 -0
  219. data/lib/ramaze/adapter/swiftiplied_mongrel.rb +7 -0
  220. data/lib/ramaze/adapter/thin.rb +22 -0
  221. data/lib/ramaze/adapter/webrick.rb +52 -0
  222. data/lib/ramaze/cache.rb +115 -0
  223. data/lib/ramaze/cache/memcached.rb +71 -0
  224. data/lib/ramaze/cache/memory.rb +6 -0
  225. data/lib/ramaze/cache/yaml_store.rb +68 -0
  226. data/lib/ramaze/contrib.rb +82 -0
  227. data/lib/ramaze/contrib/auto_params.rb +135 -0
  228. data/lib/ramaze/contrib/auto_params/get_args.rb +57 -0
  229. data/lib/ramaze/contrib/email.rb +84 -0
  230. data/lib/ramaze/contrib/facebook.rb +23 -0
  231. data/lib/ramaze/contrib/facebook/facebook.rb +171 -0
  232. data/lib/ramaze/contrib/file_cache.rb +65 -0
  233. data/lib/ramaze/contrib/gems.rb +65 -0
  234. data/lib/ramaze/contrib/gettext.rb +113 -0
  235. data/lib/ramaze/contrib/gettext/mo.rb +155 -0
  236. data/lib/ramaze/contrib/gettext/parser.rb +46 -0
  237. data/lib/ramaze/contrib/gettext/po.rb +109 -0
  238. data/lib/ramaze/contrib/gzip_filter.rb +56 -0
  239. data/lib/ramaze/contrib/profiling.rb +36 -0
  240. data/lib/ramaze/contrib/rest.rb +14 -0
  241. data/lib/ramaze/contrib/sequel/fill.rb +12 -0
  242. data/lib/ramaze/contrib/sequel_cache.rb +92 -0
  243. data/lib/ramaze/controller.rb +281 -0
  244. data/lib/ramaze/controller/error.rb +46 -0
  245. data/lib/ramaze/controller/main.rb +2 -0
  246. data/lib/ramaze/controller/resolve.rb +252 -0
  247. data/lib/ramaze/current.rb +70 -0
  248. data/lib/ramaze/current/request.rb +204 -0
  249. data/lib/ramaze/current/response.rb +27 -0
  250. data/lib/ramaze/current/session.rb +181 -0
  251. data/lib/ramaze/current/session/flash.rb +79 -0
  252. data/lib/ramaze/current/session/hash.rb +66 -0
  253. data/lib/ramaze/dispatcher.rb +137 -0
  254. data/lib/ramaze/dispatcher/action.rb +41 -0
  255. data/lib/ramaze/dispatcher/directory.rb +119 -0
  256. data/lib/ramaze/dispatcher/error.rb +108 -0
  257. data/lib/ramaze/dispatcher/file.rb +95 -0
  258. data/lib/ramaze/error.rb +24 -0
  259. data/lib/ramaze/gestalt.rb +129 -0
  260. data/lib/ramaze/helper.rb +78 -0
  261. data/lib/ramaze/helper/aspect.rb +110 -0
  262. data/lib/ramaze/helper/auth.rb +125 -0
  263. data/lib/ramaze/helper/cache.rb +140 -0
  264. data/lib/ramaze/helper/cgi.rb +47 -0
  265. data/lib/ramaze/helper/flash.rb +59 -0
  266. data/lib/ramaze/helper/form.rb +281 -0
  267. data/lib/ramaze/helper/formatting.rb +118 -0
  268. data/lib/ramaze/helper/httpdigest.rb +49 -0
  269. data/lib/ramaze/helper/identity.rb +105 -0
  270. data/lib/ramaze/helper/link.rb +124 -0
  271. data/lib/ramaze/helper/markaby.rb +31 -0
  272. data/lib/ramaze/helper/maruku.rb +7 -0
  273. data/lib/ramaze/helper/nitroform.rb +14 -0
  274. data/lib/ramaze/helper/pager.rb +366 -0
  275. data/lib/ramaze/helper/partial.rb +96 -0
  276. data/lib/ramaze/helper/redirect.rb +82 -0
  277. data/lib/ramaze/helper/rest.rb +43 -0
  278. data/lib/ramaze/helper/sendfile.rb +16 -0
  279. data/lib/ramaze/helper/sequel.rb +55 -0
  280. data/lib/ramaze/helper/stack.rb +72 -0
  281. data/lib/ramaze/helper/tagz.rb +19 -0
  282. data/lib/ramaze/helper/user.rb +78 -0
  283. data/lib/ramaze/log.rb +27 -0
  284. data/lib/ramaze/log/analogger.rb +37 -0
  285. data/lib/ramaze/log/growl.rb +35 -0
  286. data/lib/ramaze/log/hub.rb +38 -0
  287. data/lib/ramaze/log/informer.rb +125 -0
  288. data/lib/ramaze/log/knotify.rb +25 -0
  289. data/lib/ramaze/log/logger.rb +23 -0
  290. data/lib/ramaze/log/logging.rb +88 -0
  291. data/lib/ramaze/log/syslog.rb +36 -0
  292. data/lib/ramaze/log/xosd.rb +88 -0
  293. data/lib/ramaze/option.rb +153 -0
  294. data/lib/ramaze/option/dsl.rb +45 -0
  295. data/lib/ramaze/option/holder.rb +143 -0
  296. data/lib/ramaze/option/merger.rb +106 -0
  297. data/lib/ramaze/route.rb +97 -0
  298. data/lib/ramaze/setup.rb +50 -0
  299. data/lib/ramaze/snippets.rb +9 -0
  300. data/lib/ramaze/snippets/array/put_within.rb +37 -0
  301. data/lib/ramaze/snippets/binding/locals.rb +13 -0
  302. data/lib/ramaze/snippets/blankslate.rb +7 -0
  303. data/lib/ramaze/snippets/dictionary.rb +504 -0
  304. data/lib/ramaze/snippets/divide.rb +20 -0
  305. data/lib/ramaze/snippets/kernel/__dir__.rb +23 -0
  306. data/lib/ramaze/snippets/kernel/acquire.rb +34 -0
  307. data/lib/ramaze/snippets/kernel/constant.rb +26 -0
  308. data/lib/ramaze/snippets/kernel/pretty_inspect.rb +15 -0
  309. data/lib/ramaze/snippets/metaid.rb +17 -0
  310. data/lib/ramaze/snippets/numeric/filesize_format.rb +25 -0
  311. data/lib/ramaze/snippets/object/instance_variable_defined.rb +8 -0
  312. data/lib/ramaze/snippets/object/pretty.rb +6 -0
  313. data/lib/ramaze/snippets/object/scope.rb +11 -0
  314. data/lib/ramaze/snippets/object/thread_accessor.rb +5 -0
  315. data/lib/ramaze/snippets/object/traits.rb +76 -0
  316. data/lib/ramaze/snippets/ordered_set.rb +40 -0
  317. data/lib/ramaze/snippets/proc/locals.rb +11 -0
  318. data/lib/ramaze/snippets/ramaze/caller_info.rb +30 -0
  319. data/lib/ramaze/snippets/ramaze/caller_lines.rb +51 -0
  320. data/lib/ramaze/snippets/ramaze/deprecated.rb +7 -0
  321. data/lib/ramaze/snippets/ramaze/thread_accessor.rb +58 -0
  322. data/lib/ramaze/snippets/string/camel_case.rb +16 -0
  323. data/lib/ramaze/snippets/string/color.rb +27 -0
  324. data/lib/ramaze/snippets/string/each.rb +8 -0
  325. data/lib/ramaze/snippets/string/esc.rb +29 -0
  326. data/lib/ramaze/snippets/string/ord.rb +15 -0
  327. data/lib/ramaze/snippets/string/snake_case.rb +15 -0
  328. data/lib/ramaze/snippets/string/start_with.rb +8 -0
  329. data/lib/ramaze/snippets/string/unindent.rb +20 -0
  330. data/lib/ramaze/snippets/struct/fill.rb +23 -0
  331. data/lib/ramaze/snippets/struct/values_at.rb +24 -0
  332. data/lib/ramaze/snippets/symbol/to_proc.rb +24 -0
  333. data/lib/ramaze/snippets/thread/into.rb +18 -0
  334. data/lib/ramaze/sourcereload.rb +169 -0
  335. data/lib/ramaze/spec.rb +1 -0
  336. data/lib/ramaze/spec/helper.rb +131 -0
  337. data/lib/ramaze/spec/helper/bacon.rb +7 -0
  338. data/lib/ramaze/spec/helper/browser.rb +88 -0
  339. data/lib/ramaze/spec/helper/mock_http.rb +69 -0
  340. data/lib/ramaze/spec/helper/pretty_output.rb +82 -0
  341. data/lib/ramaze/spec/helper/requester.rb +63 -0
  342. data/lib/ramaze/spec/helper/simple_http.rb +434 -0
  343. data/lib/ramaze/spec/helper/snippets.rb +6 -0
  344. data/lib/ramaze/store/default.rb +109 -0
  345. data/lib/ramaze/template.rb +84 -0
  346. data/lib/ramaze/template/amrita2.rb +45 -0
  347. data/lib/ramaze/template/builder.rb +28 -0
  348. data/lib/ramaze/template/erubis.rb +41 -0
  349. data/lib/ramaze/template/ezamar.rb +42 -0
  350. data/lib/ramaze/template/ezamar/element.rb +169 -0
  351. data/lib/ramaze/template/ezamar/engine.rb +76 -0
  352. data/lib/ramaze/template/ezamar/morpher.rb +135 -0
  353. data/lib/ramaze/template/ezamar/render_partial.rb +31 -0
  354. data/lib/ramaze/template/haml.rb +37 -0
  355. data/lib/ramaze/template/liquid.rb +36 -0
  356. data/lib/ramaze/template/markaby.rb +52 -0
  357. data/lib/ramaze/template/nagoro.rb +52 -0
  358. data/lib/ramaze/template/none.rb +14 -0
  359. data/lib/ramaze/template/redcloth.rb +25 -0
  360. data/lib/ramaze/template/remarkably.rb +38 -0
  361. data/lib/ramaze/template/sass.rb +37 -0
  362. data/lib/ramaze/template/tagz.rb +79 -0
  363. data/lib/ramaze/template/tenjin.rb +74 -0
  364. data/lib/ramaze/template/xslt.rb +100 -0
  365. data/lib/ramaze/tool.rb +9 -0
  366. data/lib/ramaze/tool/create.rb +74 -0
  367. data/lib/ramaze/tool/localize.rb +198 -0
  368. data/lib/ramaze/tool/mime.rb +25 -0
  369. data/lib/ramaze/tool/mime_types.yaml +615 -0
  370. data/lib/ramaze/tool/record.rb +6 -0
  371. data/lib/ramaze/trinity.rb +13 -0
  372. data/lib/ramaze/version.rb +14 -0
  373. data/lib/vendor/bacon.rb +323 -0
  374. data/rake_tasks/conf.rake +83 -0
  375. data/rake_tasks/coverage.rake +46 -0
  376. data/rake_tasks/darcs.rake +14 -0
  377. data/rake_tasks/gem.rake +85 -0
  378. data/rake_tasks/git.rake +4 -0
  379. data/rake_tasks/maintenance.rake +436 -0
  380. data/rake_tasks/spec.rake +62 -0
  381. data/spec/contrib/auto_params.rb +121 -0
  382. data/spec/contrib/profiling.rb +29 -0
  383. data/spec/contrib/sequel/fill.rb +47 -0
  384. data/spec/examples/caching.rb +19 -0
  385. data/spec/examples/css.rb +15 -0
  386. data/spec/examples/element.rb +15 -0
  387. data/spec/examples/hello.rb +11 -0
  388. data/spec/examples/linking.rb +18 -0
  389. data/spec/examples/simple.rb +45 -0
  390. data/spec/examples/simple_auth.rb +32 -0
  391. data/spec/examples/templates/template_amrita2.rb +16 -0
  392. data/spec/examples/templates/template_erubis.rb +23 -0
  393. data/spec/examples/templates/template_ezamar.rb +23 -0
  394. data/spec/examples/templates/template_haml.rb +25 -0
  395. data/spec/examples/templates/template_liquid.rb +29 -0
  396. data/spec/examples/templates/template_markaby.rb +23 -0
  397. data/spec/examples/templates/template_redcloth.rb +28 -0
  398. data/spec/examples/templates/template_remarkably.rb +23 -0
  399. data/spec/examples/templates/template_tenjin.rb +28 -0
  400. data/spec/helper.rb +3 -0
  401. data/spec/ramaze/action/basics.rb +36 -0
  402. data/spec/ramaze/action/cache.rb +87 -0
  403. data/spec/ramaze/action/file_cache.rb +48 -0
  404. data/spec/ramaze/action/layout.rb +190 -0
  405. data/spec/ramaze/action/render.rb +32 -0
  406. data/spec/ramaze/action/view/bar.xhtml +1 -0
  407. data/spec/ramaze/action/view/instancevars/layout.xhtml +1 -0
  408. data/spec/ramaze/action/view/other_wrapper.xhtml +1 -0
  409. data/spec/ramaze/action/view/single_wrapper.xhtml +1 -0
  410. data/spec/ramaze/action/view/sub/sub_wrapper.xhtml +1 -0
  411. data/spec/ramaze/adapter.rb +39 -0
  412. data/spec/ramaze/adapter/ebb.rb +12 -0
  413. data/spec/ramaze/adapter/mongrel.rb +12 -0
  414. data/spec/ramaze/adapter/record.rb +31 -0
  415. data/spec/ramaze/adapter/webrick.rb +12 -0
  416. data/spec/ramaze/cache.rb +140 -0
  417. data/spec/ramaze/controller.rb +177 -0
  418. data/spec/ramaze/controller/actionless_templates.rb +32 -0
  419. data/spec/ramaze/controller/resolve.rb +32 -0
  420. data/spec/ramaze/controller/subclass.rb +21 -0
  421. data/spec/ramaze/controller/template_resolving.rb +113 -0
  422. data/spec/ramaze/controller/view/greet.xhtml +1 -0
  423. data/spec/ramaze/controller/view/list.xhtml +1 -0
  424. data/spec/ramaze/controller/view/other/greet/other.xhtml +1 -0
  425. data/spec/ramaze/controller/view/other_wrapper.xhtml +1 -0
  426. data/spec/ramaze/current/request.rb +30 -0
  427. data/spec/ramaze/current/session.rb +97 -0
  428. data/spec/ramaze/dispatcher.rb +31 -0
  429. data/spec/ramaze/dispatcher/directory.rb +55 -0
  430. data/spec/ramaze/dispatcher/file.rb +60 -0
  431. data/spec/ramaze/dispatcher/public/favicon.ico +0 -0
  432. data/spec/ramaze/dispatcher/public/file name.txt +1 -0
  433. data/spec/ramaze/dispatcher/public/test_download.css +141 -0
  434. data/spec/ramaze/element.rb +107 -0
  435. data/spec/ramaze/error.rb +94 -0
  436. data/spec/ramaze/gestalt.rb +131 -0
  437. data/spec/ramaze/helper/aspect.rb +92 -0
  438. data/spec/ramaze/helper/auth.rb +66 -0
  439. data/spec/ramaze/helper/cache.rb +160 -0
  440. data/spec/ramaze/helper/cgi.rb +43 -0
  441. data/spec/ramaze/helper/file.rb +18 -0
  442. data/spec/ramaze/helper/flash.rb +133 -0
  443. data/spec/ramaze/helper/form.rb +118 -0
  444. data/spec/ramaze/helper/formatting.rb +41 -0
  445. data/spec/ramaze/helper/link.rb +124 -0
  446. data/spec/ramaze/helper/pager.rb +99 -0
  447. data/spec/ramaze/helper/partial.rb +76 -0
  448. data/spec/ramaze/helper/redirect.rb +112 -0
  449. data/spec/ramaze/helper/stack.rb +73 -0
  450. data/spec/ramaze/helper/user.rb +43 -0
  451. data/spec/ramaze/helper/view/locals.xhtml +1 -0
  452. data/spec/ramaze/helper/view/loop.xhtml +4 -0
  453. data/spec/ramaze/helper/view/num.xhtml +1 -0
  454. data/spec/ramaze/helper/view/partial.xhtml +1 -0
  455. data/spec/ramaze/helper/view/recursive.xhtml +8 -0
  456. data/spec/ramaze/helper/view/recursive_local_ivars.xhtml +7 -0
  457. data/spec/ramaze/helper/view/recursive_locals.xhtml +7 -0
  458. data/spec/ramaze/helper/view/test_template.xhtml +1 -0
  459. data/spec/ramaze/localize.rb +89 -0
  460. data/spec/ramaze/log/informer.rb +72 -0
  461. data/spec/ramaze/log/syslog.rb +10 -0
  462. data/spec/ramaze/morpher.rb +111 -0
  463. data/spec/ramaze/params.rb +157 -0
  464. data/spec/ramaze/public/error404.xhtml +1 -0
  465. data/spec/ramaze/public/favicon.ico +0 -0
  466. data/spec/ramaze/public/ramaze.png +0 -0
  467. data/spec/ramaze/public/test_download.css +141 -0
  468. data/spec/ramaze/request.rb +185 -0
  469. data/spec/ramaze/request/ebb.rb +9 -0
  470. data/spec/ramaze/request/mongrel.rb +9 -0
  471. data/spec/ramaze/request/thin.rb +9 -0
  472. data/spec/ramaze/request/webrick.rb +5 -0
  473. data/spec/ramaze/rewrite.rb +36 -0
  474. data/spec/ramaze/rewrite/file.css +1 -0
  475. data/spec/ramaze/route.rb +131 -0
  476. data/spec/ramaze/session.rb +94 -0
  477. data/spec/ramaze/store/default.rb +71 -0
  478. data/spec/ramaze/template.rb +128 -0
  479. data/spec/ramaze/template/amrita2.rb +50 -0
  480. data/spec/ramaze/template/amrita2/external.amrita +6 -0
  481. data/spec/ramaze/template/amrita2/sum.amrita +1 -0
  482. data/spec/ramaze/template/builder.rb +55 -0
  483. data/spec/ramaze/template/builder/external.rxml +3 -0
  484. data/spec/ramaze/template/erubis.rb +41 -0
  485. data/spec/ramaze/template/erubis/sum.rhtml +1 -0
  486. data/spec/ramaze/template/ezamar.rb +63 -0
  487. data/spec/ramaze/template/ezamar/another/long/action.zmr +1 -0
  488. data/spec/ramaze/template/ezamar/combined.zmr +1 -0
  489. data/spec/ramaze/template/ezamar/file_only.zmr +1 -0
  490. data/spec/ramaze/template/ezamar/index.zmr +1 -0
  491. data/spec/ramaze/template/ezamar/nested.zmr +1 -0
  492. data/spec/ramaze/template/ezamar/other__index.xhtml +1 -0
  493. data/spec/ramaze/template/ezamar/some__long__action.zmr +1 -0
  494. data/spec/ramaze/template/ezamar/sum.zmr +1 -0
  495. data/spec/ramaze/template/haml.rb +66 -0
  496. data/spec/ramaze/template/haml/index.haml +5 -0
  497. data/spec/ramaze/template/haml/locals.haml +2 -0
  498. data/spec/ramaze/template/haml/with_vars.haml +4 -0
  499. data/spec/ramaze/template/liquid.rb +99 -0
  500. data/spec/ramaze/template/liquid/index.liquid +1 -0
  501. data/spec/ramaze/template/liquid/products.liquid +45 -0
  502. data/spec/ramaze/template/markaby.rb +61 -0
  503. data/spec/ramaze/template/markaby/external.mab +8 -0
  504. data/spec/ramaze/template/markaby/sum.mab +1 -0
  505. data/spec/ramaze/template/nagoro.rb +64 -0
  506. data/spec/ramaze/template/nagoro/another/long/action.nag +1 -0
  507. data/spec/ramaze/template/nagoro/combined.nag +1 -0
  508. data/spec/ramaze/template/nagoro/file_only.nag +1 -0
  509. data/spec/ramaze/template/nagoro/index.nag +1 -0
  510. data/spec/ramaze/template/nagoro/nested.nag +1 -0
  511. data/spec/ramaze/template/nagoro/some__long__action.nag +1 -0
  512. data/spec/ramaze/template/nagoro/sum.nag +1 -0
  513. data/spec/ramaze/template/ramaze/external.test +1 -0
  514. data/spec/ramaze/template/redcloth.rb +38 -0
  515. data/spec/ramaze/template/redcloth/external.redcloth +1 -0
  516. data/spec/ramaze/template/remarkably.rb +58 -0
  517. data/spec/ramaze/template/remarkably/external.rem +8 -0
  518. data/spec/ramaze/template/remarkably/sum.rem +1 -0
  519. data/spec/ramaze/template/sass.rb +69 -0
  520. data/spec/ramaze/template/sass/file.css.sass +5 -0
  521. data/spec/ramaze/template/tagz.rb +62 -0
  522. data/spec/ramaze/template/tagz/external.tagz +8 -0
  523. data/spec/ramaze/template/tagz/sum.tagz +1 -0
  524. data/spec/ramaze/template/tenjin.rb +47 -0
  525. data/spec/ramaze/template/tenjin/external.tenjin +1 -0
  526. data/spec/ramaze/template/xslt.rb +90 -0
  527. data/spec/ramaze/template/xslt/concat_words.xsl +16 -0
  528. data/spec/ramaze/template/xslt/index.xsl +14 -0
  529. data/spec/ramaze/template/xslt/products.xsl +32 -0
  530. data/spec/ramaze/template/xslt/ruby_version.xsl +14 -0
  531. data/spec/snippets/array/put_within.rb +33 -0
  532. data/spec/snippets/divide.rb +19 -0
  533. data/spec/snippets/kernel/__dir__.rb +8 -0
  534. data/spec/snippets/kernel/acquire.rb +71 -0
  535. data/spec/snippets/kernel/constant.rb +23 -0
  536. data/spec/snippets/numeric/filesize_format.rb +12 -0
  537. data/spec/snippets/ordered_set.rb +63 -0
  538. data/spec/snippets/ramaze/caller_info.rb +39 -0
  539. data/spec/snippets/ramaze/caller_lines.rb +30 -0
  540. data/spec/snippets/string/camel_case.rb +25 -0
  541. data/spec/snippets/string/color.rb +11 -0
  542. data/spec/snippets/string/snake_case.rb +24 -0
  543. data/spec/snippets/string/unindent.rb +43 -0
  544. data/spec/snippets/struct/fill.rb +26 -0
  545. data/spec/snippets/struct/values_at.rb +44 -0
  546. data/spec/snippets/symbol/to_proc.rb +13 -0
  547. data/spec/snippets/thread/into.rb +20 -0
  548. metadata +789 -0
data/doc/INSTALL ADDED
@@ -0,0 +1,34 @@
1
+ = Installating Ramaze
2
+
3
+ * via RubyGems
4
+
5
+ The simplest way of installing Ramaze is via
6
+
7
+ $ gem install ramaze
8
+
9
+ in case you have RubyGems installed.
10
+ (this will work as soon as I have registered on RubyForge ;)
11
+
12
+ * via install.rb
13
+
14
+ Ramaze provides a basic install.rb that should take care of the installation
15
+ you can use it like
16
+
17
+ $ ruby install.rb
18
+
19
+ you may need root-privileges to do
20
+ that, depending on what options you provide.
21
+ (please note that I haven't tested the install.rb extensively yet, so if you
22
+ find some quirks, please send me patches or a simple note)
23
+
24
+ * via darcs
25
+
26
+ To get the latest and sweetest, you can just pull from the repository and run
27
+ Ramaze that way.
28
+
29
+ $ darcs get --partial http://manveru.mine.nu/ramaze
30
+
31
+ Please read the man page or `darcs help` for more information about updating
32
+ and creating your own patches.
33
+ This is at the moment the premier way to use Ramaze, since it is the way I use
34
+ it.
data/doc/LEGAL ADDED
@@ -0,0 +1,26 @@
1
+ This is a list of files included into ramaze but under different licenses.
2
+ Also included are files that are not under the copyright from Michael Fellinger.
3
+
4
+ lib/ramaze/helper/pager.rb
5
+ License: BSD License
6
+ Author: George K. Moschovitis
7
+
8
+ lib/ramaze/snippets/dictionary.rb
9
+ License: Ruby License
10
+ Authors: Jan Molic and Thomas Sawyer
11
+
12
+ lib/proto/js/jquery.js
13
+ License: Dual licensed under MIT and GPL
14
+ Author: John Resig
15
+
16
+ lib/ramaze/spec/helper/simple_http.rb
17
+ License: GPL
18
+ Author: Tim Becker
19
+
20
+ lib/ramaze/template/xslt.rb
21
+ License: Ruby
22
+ Author: Stephan Maka
23
+
24
+ lib/vendor/bacon.rb
25
+ License: MIT
26
+ Author: Christian Neukirchen
data/doc/ProjectInfo ADDED
@@ -0,0 +1,53 @@
1
+ ---
2
+ project : ramaze
3
+ version : '0.0.7'
4
+ status : alpha
5
+
6
+ title : Ramaze
7
+ subtitle : A light and modular Web-Framework
8
+ description : >
9
+ Ramaze is a very simple and straight-forward web-framework.
10
+ The philosophy of it could be expressed in a mix of KISS and POLS, trying to
11
+ make simple things simple and complex things possible.
12
+
13
+ author : Michael Fellinger <m.fellinger@gmail.com>
14
+ created : "2006-10-14"
15
+ homepage : "http://ramaze.rubyforge.org"
16
+ download : "https://rubyforge.org/frs/?group_id=3034"
17
+ repository : "http://manveru.mine.nu/darcs/ramaze"
18
+ slogan : Ramaze, light and modular
19
+ #signiture : "../_privkey.pem"
20
+
21
+ pack : [gem, tgz, bz2]
22
+ distribute : [ -scrap ]
23
+ dependency :
24
+ - [ autorake, >= 0.5.1 ]
25
+ executable : [ bin/ramaze ]
26
+
27
+ #digest : sha256
28
+ #manifest : MANIFEST.txt
29
+ archive : ~/ruby/ARCHIVE
30
+ scm : darcs
31
+ scm_ignore : [ doc/allison ]
32
+ changelog : doc/CHANGELOG
33
+ stamp : doc/VERSION
34
+
35
+ rdoc:
36
+ template : allison
37
+
38
+ mail:
39
+ server : smtp.gmail.com
40
+ account : m.fellinger@gmail.com
41
+ mail_to : m.fellinger@gmail.com
42
+
43
+ rubyforge:
44
+ project : ramaze
45
+ username : manveru
46
+ groupid : 3034
47
+ package : ramaze
48
+
49
+ #host:
50
+ # domain : rubyforge.org
51
+ # user : transami
52
+ # root : '/var/www/gforge-projects/ratchets'
53
+
data/doc/TODO ADDED
@@ -0,0 +1,29 @@
1
+ This list is programmaticly generated by `rake todolist`
2
+ If you want to add/remove items from the list, change them at the
3
+ position specified in the list.
4
+
5
+ /home/manveru/prog/projects/ramaze/lib/ramaze/template/ezamar/morpher.rb
6
+ - Add pure Ruby implementation as a fall-back.
7
+
8
+ /home/manveru/prog/projects/ramaze/lib/ramaze/helper/pager.rb
9
+ ++
10
+
11
+ /home/manveru/prog/projects/ramaze/spec/ramaze/action/basics.rb
12
+
13
+ /home/manveru/prog/projects/ramaze/lib/ramaze/template/ezamar/engine.rb
14
+ - provide C version or maybe use erbuis
15
+
16
+ /home/manveru/prog/projects/ramaze/lib/ramaze/template/xslt.rb
17
+ * Error handling
18
+ * Maybe prevent extFunction to be called by HTTP
19
+
20
+ /home/manveru/prog/projects/ramaze/lib/ramaze/helper/identity.rb
21
+ - maybe using StackHelper, but this is a really minimal overlap?
22
+
23
+ /home/manveru/prog/projects/ramaze/spec/snippets/ramaze/caller_info.rb
24
+
25
+ /home/manveru/prog/projects/ramaze/lib/ramaze/snippets/dictionary.rb
26
+ ++
27
+
28
+ /home/manveru/prog/projects/ramaze/lib/ramaze/helper/redirect.rb
29
+ - maybe some more options, like a delay
@@ -0,0 +1,126 @@
1
+ This time we are proud to announce Version 0.3.5 of Ramaze, the light and
2
+ modular open source web framework.
3
+
4
+ This release features a lot of work directly from our community and we are
5
+ really greatful for everybody who helped in testing, patching and contributing
6
+ exciting new features.
7
+
8
+ Our extensive set of specs and docs now covers almost every detail of
9
+ implementation and usage. Ramaze is under development by a growing community
10
+ and in production use at companies.
11
+
12
+
13
+ Home page: http://ramaze.net
14
+ Screencasts: http://ramaze.net/screencasts
15
+
16
+ View source: http://source.ramaze.net
17
+ Darcsweb: http://darcs.ramaze.net
18
+
19
+ IRC: #ramaze on irc.freenode.net
20
+
21
+
22
+ Simple example:
23
+
24
+ require 'ramaze'
25
+
26
+ class MainController
27
+ def index
28
+ 'Hello, World!'
29
+ end
30
+ end
31
+
32
+ Ramaze.start
33
+
34
+
35
+ Special (alphabetic) thanks go to:
36
+
37
+ Aman 'tmm1' Gupta - patches and support
38
+ Carlo Zottmann - first patch!
39
+ Chris 'celldee' Duncan - first patch!
40
+ Gabriele 'riffraff' Renzi - patches for file dispatcher
41
+ jeedee - new Ramaze logo
42
+ Jonathan 'Kashia' Buch - patches and support
43
+ Keita Yamaguchi - first patch!
44
+ Pistos - lots of friendly support
45
+ skaar - first patch!
46
+
47
+
48
+ Selected summary of the 62 patches from 0.3.0 to 0.3.5:
49
+
50
+ Core
51
+ - Ramaze::Contrib::Route made available by default as Ramaze::Route
52
+ (backwards compatibility retained)
53
+ - Support added for ETag and If-Modified-Since in Dispatcher::File
54
+ - Adapter for LiteSpeed webserver added
55
+ - Added ability to set default session cookie options using Session::COOKIE
56
+ - Support added for Content-Language based localization and gettext
57
+
58
+ Templates
59
+ - Support added for passing in locals to render_template
60
+ - Added support for symbol argument to template_root
61
+ - render_template no longer requires template extensions
62
+ - Dots allowed in template extensions (template.html.erb)
63
+
64
+ Templating Engines
65
+ - Builder templating engine added to produce XML
66
+ - RedCloth templating engine added
67
+ - Amrita2 templating engine updated to latest release
68
+
69
+ Helpers
70
+ - Simple EmailHelper added
71
+ - IdentityHelper updated for latest ruby-openid
72
+ - MarukuHelper added
73
+ - AuthHelper cleaned up
74
+ - LinkHelper improved: A(), R(), Rs() and breadcrumbs
75
+
76
+ Examples
77
+ - All examples were standardized to include rubygems
78
+ - Simple file upload example added
79
+ - Search and diff functionality added to Rapaste
80
+
81
+ Misc
82
+ - Read and read/write issues fixed in Ramaze::Store
83
+ - Fix applied for running Ramaze apps within IDEs on Windows
84
+
85
+
86
+ A complete Changelog is available at
87
+ http://darcs.ramaze.net/ramaze/doc/CHANGELOG
88
+
89
+
90
+ Known issues:
91
+
92
+ - none yet, waiting for your reports :)
93
+
94
+
95
+ Ramaze Features:
96
+ - Builds on top of the Rack library, which provides easy use of adapters like
97
+ Mongrel, WEBrick, LiteSpeed, Thin, CGI or FCGI.
98
+
99
+ - Supports a wide range of templating-engines like: Amrita2, Erubis, Haml,
100
+ Liquid, Markaby, Remarkably and its own engine called Ezamar and (still
101
+ unofficial) Nagoro.
102
+
103
+ - Highly modular structure: you can just use the parts you like. This also
104
+ means that it's very simple to add your own customizations.
105
+
106
+ - A variety of helpers is already available, giving you things like advanced
107
+ caching, OpenID-authentication or aspect-oriented programming for your
108
+ controllers.
109
+
110
+ - It is possible to use the ORM you like, be it Sequel, DataMapper,
111
+ ActiveRecord, Og, Kansas or something more simplistic like DBI, or a
112
+ wrapper around YAML::Store.
113
+
114
+ - Good documentation: although we don't have 100% documentation right now
115
+ (dcov says around 75%), just about every part of Ramaze is covered with
116
+ basic and advanced docs. There are a variety of examples, screencasts and a
117
+ tutorial available.
118
+
119
+ - Friendly community: there are people from all over the world using Ramaze,
120
+ so you can get almost instant help and info.
121
+
122
+
123
+ For more information please come to http://ramaze.net or ask directly on IRC
124
+ irc://irc.freenode.net/#ramaze
125
+
126
+ Thank you, Michael 'manveru' Fellinger and the Ramaze community
@@ -0,0 +1,162 @@
1
+ This chapter covers how to do configuration in Ramaze for your application.
2
+
3
+
4
+ ### Global
5
+
6
+ The object holding most configuration is called Global. It resides in the Ramaze
7
+ module/name space.
8
+
9
+ Global is an instance of GlobalStruct, which itself is an instance of Struct.
10
+ There have been some changes to it to suit its purpose.
11
+
12
+ Before covering some of the available options let us see how to actually use it.
13
+
14
+ For the examples shown here we will assume that you did include Ramaze
15
+ into your main into your main name space. If you don't do that, just prefix
16
+ Global with Ramaze so it is written Ramaze::Global.
17
+
18
+
19
+ #### Basic assignment:
20
+
21
+ Global.spawn = 10
22
+
23
+ if you do that before calling Ramaze::start Ramaze will spawn the given number of servers.
24
+
25
+
26
+ #### Multiple assignment:
27
+
28
+ Global.setup :adapter => :mongrel,
29
+ :cache => :memcached
30
+
31
+ So you can pass a Hash of all the options you want to change.
32
+ In this case you would use Mongrel as the adapter and use memcached for your
33
+ sessions and general caching.
34
+
35
+
36
+ #### Block assignment:
37
+
38
+ Global.setup do |g|
39
+ g.error_page = false
40
+ g.host = '127.0.0.1'
41
+ g.port = 7070
42
+ end
43
+
44
+ This method is similar to the hash-assignment, but may be preferred for some
45
+ applications.
46
+
47
+
48
+ #### Pass on Ramaze.start
49
+
50
+ Ramaze.start :run_loose => true
51
+
52
+ This way you can save a line or two in a small script.
53
+ Please note that the values passed here have precedence over the ones directly
54
+ set on Global and will overwrite them if you set them before, that is mostly
55
+ useful to quickly test some configuration.
56
+
57
+
58
+ ### Global options
59
+
60
+ This listing is here to provide you with descriptions of the most common
61
+ configurations in alphabetical order per section showing the default value next
62
+ to the key.
63
+
64
+ This chapter has been shrunk a lot to cover only essentials, please look at
65
+ lib/ramaze/global.rb to see all available options.
66
+
67
+ Date of last update: 2007-05-20
68
+
69
+ #### General Configuration:
70
+
71
+ :sourcereload => 3
72
+
73
+ SourceReload is a nifty mechanism that takes advantage of the dynamics of Ruby,
74
+ it's basically a Thread that runs in the background and polls for files in the
75
+ application and framework that have changed (using mtime). The value specifies
76
+ roughly how fast your changes are going to be loaded and should be a number.
77
+ If you set this to false, it will not start.
78
+
79
+
80
+ :adapter => :webrick
81
+
82
+ The adapter is the server Ramaze runs to serve your application. This can be any
83
+ of mongrel/webrick/fcgi/cgi, please note that so far neither fcgi nor cgi have
84
+ received the necessary testing, but, as they are only wrappers around the
85
+ underlying Rack library, should work fine. Both fcgi and mongrel require
86
+ additional libraries to be installed, webrick and cgi run out of the box.
87
+ Generally the most supported and recommended for deployment is Mongrel.
88
+
89
+
90
+ :cache => :memory
91
+
92
+ Possible: :memory, :memcached, :yaml
93
+ The cache is one of the more important things for deployment, the default for
94
+ this is MemoryCache, a simple Hash.
95
+ What you specify here will be used by Ramaze::Cache and is used throughout
96
+ Ramaze to cache various things, like sessions, page- and value-caching.
97
+ Included in Ramaze are the MemoryCache and YAMLStoreCache, after you install
98
+ 'memcached' you can also use the much more performant MemcachedCache that also
99
+ makes it easy to use the same cache between different applications (sharing
100
+ sessions is one of the most obvious uses).
101
+
102
+
103
+ :cache_all => false
104
+
105
+ Setting this value to true would enable caching for all pages served from the
106
+ Controller (all actions).
107
+ This is a very powerful setting and you might want to enable it if all pages
108
+ you serve are only built once and have no further dynamics, the key for this
109
+ cache consists of the controller and parameters, when repeated requests are
110
+ made it will always serve the same (now static) page.
111
+
112
+
113
+ :sessions => true
114
+
115
+ Enables creation of sessions and automatic creation/setting of cookies.
116
+ Please note that many functionalities of Ramaze depend on an intact session and
117
+ you will have to be careful not to use these.
118
+ This is most likely useful in combination with `cache_all`
119
+
120
+
121
+ :error_page => true
122
+
123
+ Enables the default Error page of Ramaze which is mostly useful for manual
124
+ testing and faster debugging. In most deployment-scenarios you will however
125
+ want to use your own Error page and so you can safely disable this setting.
126
+
127
+ :host => '0.0.0.0'
128
+
129
+ Tell the adapter where it accepts requests from, 0.0.0.0 says that every
130
+ IP will be accepted, 127.0.0.1 would accept only requests from loopback.
131
+
132
+
133
+ :mapping => {}
134
+
135
+ This is a very central and special setting, it contains key/value pairs
136
+ that define routes to your controllers, the keys are simple strings and
137
+ start with '/', which means http://yourhost.com/ - '/foo/bar' would point
138
+ to http://yourhost.com/foo/bar.
139
+ The value is the class of your controller.
140
+
141
+
142
+ :port => 7000
143
+
144
+ The port Ramaze runs on, if you can think of more information about this feel
145
+ free to tell us.
146
+
147
+
148
+ :run_loose => false
149
+
150
+ This option is mostly used to run the specs, it means that Ramaze will not
151
+ join the adapter-threads and therefor you are free to run any code you want
152
+ afterwards. You won't have to use this in most cases, example usage is in
153
+ spec/spec_helper.
154
+
155
+
156
+ :template_root => 'template'
157
+
158
+ The template_root is the point your templates are located relative to the
159
+ location of the entry-file (usually start.rb)
160
+ It is also worth to mention that inside this directory the `mapping` is used
161
+ to locate templates for each controller, only the controller mapped to '/' uses
162
+ the templates directly from the `template_root`
@@ -0,0 +1,278 @@
1
+ This document is a humble attempt to explain the internal workings of Ramaze and
2
+ how the different parts fit into the big picture.
3
+
4
+ It does not try to describe every little detail, as you will be better off
5
+ reading the actual source instead. But you will at least get an idea of where to
6
+ look.
7
+
8
+ ### Ramaze
9
+
10
+ Ramaze is a web framework and therefor tries to make it simple to deploy your
11
+ own applications on top of it.
12
+ Let's outline the realms that Ramaze works in as to show what the current
13
+ limitations and features are.
14
+
15
+
16
+ #### Life of a request/response cycle
17
+
18
+ This is a small summary of how a request creates a response in the
19
+ examples/hello.rb and webrick (to keep it simple and short).
20
+ All files referenced here are in lib/ramaze/ unless indicated otherwise.
21
+ We don't explain the startup/shutdown process, only what happens from request to
22
+ the eventual response.
23
+
24
+ Browser sends request, webrick receives it and hands the ENV over to our rack
25
+ handler (adapter/webrick.rb and adapter/base.rb).
26
+ There it gets converted into a Ramaze::Request (trinity/request.rb) and
27
+ a new blank Ramaze::Response (trinity/response.rb) is created.
28
+ These two objects are then sent to Dispatcher::handle (dispatcher.rb).
29
+
30
+ This all happens inside a new Thread, which is what Ramaze takes advantage of by
31
+ assigning Thread-variables. You can see this now in
32
+ Dispatcher::setup_environment which sets :request/:session/:response in
33
+ Thread.current.
34
+
35
+ After that, Dispatcher::dispatch is called with the path from request.path_info
36
+ which in turn takes every class/module set in Dispatcher::FILTER and calls
37
+ ::process with the path.
38
+
39
+
40
+ ##### First, `/favicon.ico` (for most browsers)
41
+
42
+ The first in FILTER is Dispatcher::File (dispatcher/file.rb) which searches
43
+ Global.public_root and afterwards Global.public_proto for a matching file on
44
+ this path. In our example the file found is a favicon.ico from
45
+ Global.public_proto.
46
+
47
+ The contents of FILTER have to return a Ramaze::Response, either the (possibly
48
+ modified) original (Response#build helps with that) or a totally new
49
+ one.
50
+
51
+ In our case, Dispatcher::File uses response#build with an opened filehandler as
52
+ body, '200 OK' as status and the Content-Type set to what Tool::MIME.type_for
53
+ tells it is the correct mimetype for this file.
54
+
55
+
56
+ ##### Second, `/hello`
57
+
58
+ We start in the processing of FILTER, since the previous steps are the same for
59
+ every request.
60
+
61
+ Here we now get only a nil value back from Dispatcher::File since no file in our
62
+ two public directories exists for the given path.
63
+
64
+ So, this time, Dispatcher::Action is called via ::process and the first thing
65
+ this dispatcher does is trying to set the body of the request to the answer of
66
+ Controller.handle (controller.rb) for the given path.
67
+
68
+ Controller::handle doesn't do much either, but calls Controller::resolve
69
+ (controller/resolve.rb) for the path.
70
+
71
+ Here we get now into the guts of Ramaze, despite our efforts it's no easy
72
+ reading since the underlying theory is a bit complex and many edge-cases have to
73
+ be solved.
74
+
75
+ Let me try to quickly sketch what happens here, maybe we can add a chapter about
76
+ this aspect of Ramaze later.
77
+
78
+ First we generate a pattern of how the requested path could fit into our
79
+ controller and template structure. `/hello` only has 3 possible outcomes:
80
+
81
+ Controller on '/', template or method `hello`
82
+ Controller on '/', method `index` with parameter `hello`
83
+ Controller on '/hello', method or template `index`
84
+
85
+ After matching (in the order we wrote here) these possibilities against your
86
+ application we get only one possibility, MainController on '/' with method
87
+ `index`.
88
+
89
+ The result is stored into an instance of Action and cached for repeated lookups,
90
+ then passed back into Dispatcher::handle which subsequently calls Action#render
91
+ (action/render.rb) on it.
92
+
93
+ From here, Thread.current[:action] gets set and #uncached_render is called. This
94
+ calls #before_process which only has effects if you have the AspectHelper
95
+ activated and next on comes engine.transform with self as parameter.
96
+ #engine is a method that figures out which engine this Action has to be rendered
97
+ with, according to things like trait[:engine] in your controller and the
98
+ extension of a template. In this case we have neither and the default engine
99
+ Template::Ezamar (template/ezamar.rb) is used.
100
+
101
+ So off we go, to Template::Ezamar::transform with the current instance of Action
102
+ as parameter.
103
+
104
+ ::transform first calls ::wrap_compile which is inherited from Template
105
+ (template.rb) and manages caching of compiled templates, calling ::compile with
106
+ the action and template.
107
+
108
+ The template again is retrieved through two attempts, firstly, we always call
109
+ the method (if specified from Controller::resolve) on the controller, we
110
+ temporarily store its result and replace it if a path for a template is set with
111
+ the contents of the file on this path. The result of this is the final template
112
+ that is ready for compilation.
113
+
114
+ In the case of Ezamar, we first walk the TRANSFORM_PIPELINE (only
115
+ Ezamar::Element (template/ezamar/element.rb) with ::transform and pass each the
116
+ template for manipulation. In the example we don't have any elements, so we get
117
+ back what we gave and generate a new instance of Ezamar::Template
118
+ (template/ezamar/engine.rb) with the template and a path that indicates eval
119
+ where we currently are supposed to be (templates path or the transformer).
120
+
121
+ This instance is passed back to Ezamar::transform and we call #result with the
122
+ actions binding (retrieved from earlier instantiation of the controller and
123
+ subsequently eval `binding` inside of it).
124
+
125
+ Now it's all done, we have got our body for the response which will be sent back
126
+ to our handler as body.
127
+
128
+
129
+ #### The Ramaze module
130
+
131
+ Ramaze is also the main module or so-called namespace that the framework lives
132
+ in. It has
133
+
134
+ Tasks on require
135
+
136
+ * Inform
137
+ * LogHub.new(Informer)
138
+ * Global
139
+ * GlobalStruct.new
140
+
141
+
142
+ Tasks on startup as defined in Ramaze.trait[:internals] in lib/ramaze.rb
143
+
144
+ * Global::startup
145
+ * passed options to Ramaze.start
146
+ * CLI options from bin/ramaze (treat as passed.merge)
147
+ * Global options set before startup (fake Global?)
148
+
149
+ * Cache::startup
150
+ * adds the following caches via Cache.add:
151
+ * compiled
152
+ If Global.compile is set true this cache is used to store the compiled
153
+ templates.
154
+
155
+ * actions
156
+ Caching compiled actions.
157
+
158
+ * patterns
159
+ This is used in Controller::resolve to cache the generated patterns for a
160
+ path.
161
+
162
+ * resolved
163
+ Caching the resolved but not yet compiled actions by their path.
164
+
165
+ * shield
166
+ Caching the generated errors for the path, so on repeated erronous
167
+ requests no new error-page has to be generated.
168
+
169
+ * Controller::startup
170
+ * mapping of all subclassed Controller
171
+ * validation of mapping
172
+ * validation of template_root
173
+
174
+ * Session::startup
175
+ * adds Cache.sessions if Global.sessions is true
176
+ This cache is used to store all sessions with their session-id as key.
177
+
178
+ * SourceReload::startup
179
+ * start with Global.reload_interval
180
+ * assign Global.sourcereload
181
+
182
+ * Adapter::startup
183
+ * interpret Global.adapter
184
+ * add every created adapter to Global.adapters
185
+
186
+
187
+ Tasks on shutdown
188
+
189
+ * Adapter::shutdown (iterates Global.adapters)
190
+ * Inform::shutdown (iterates all in LogHub)
191
+
192
+
193
+
194
+ #### Global configuration
195
+
196
+ Any serious application or framework needs to be configured.
197
+ Yes, I wished there was a silver bullet to serve all your needs as well, but at
198
+ the current stage of programming development there is no such thing.
199
+ So, since we need to configure, we should make it as simple and painless as
200
+ possible, and, thanks to Ruby, it is actually quite enjoyable to do that.
201
+ You can find a very detailed description about Global in the section about
202
+ Configuration, for now just the basics.
203
+
204
+ The basis of Ramaze::Global, the instance that is holding most part of your
205
+ configuration or at least links to the actual places, is the
206
+ Ramaze::GlobalStruct (ramaze/global.rb), which is a subclass of OpenStruct. If
207
+ you are not yet familiar with OpenStruct, I very much recommend to read its
208
+ documentation and play around a bit, it is basically just a wrapper around a
209
+ normal Hash where you can access the keys instead of ostruct[:foo] with
210
+ ostruct.foo.
211
+ It simply defines a new accessors on assignment by catching things in
212
+ method_missing. I won't go into more details here, I hope you got the principle.
213
+
214
+ Now, based on this technique, GlobalStruct adds things like defaults and a
215
+ couple of convenience methods like they are common in Ruby, giving you more
216
+ power by tapping to the internal Hash of the GlobalStruct and adding
217
+ update/setup methods so you can assign many key/value pairs at once.
218
+ The RDocs will give you a very good overview of what is available and how one is
219
+ supposed to work with it.
220
+
221
+ Now back to the big picture.
222
+
223
+ Ramaze accesses Global all over the place, there have been made several choices
224
+ as to why using something like Global is considered beneficial against choosing
225
+ for example global variables, which would be considered as a fatal choice by
226
+ any respected Rubyist anyway.
227
+
228
+ Now to something more subtle, which has to do with Global. I speak about traits,
229
+ which is a very different concept in most of its implementations, but it is
230
+ something that basically fits this name. It is configuration of single Objects
231
+ and whole ancestries.
232
+ You can give an object a trait, and most likely will use it along the lines of
233
+ something like MyController.trait(:map => '/'), which would be picked up on
234
+ startup and used to create Global.mapping - where we are at configuration again.
235
+ Choosing this style of configuration complementary to a central place to put all
236
+ your configuration was made very early in the development of Ramaze, and the
237
+ basic code of how traits are implemented and used has proven very efficient both
238
+ in understanding and using them.
239
+
240
+ There is a basic distinction when to use Global and when to use traits and when
241
+ to generate or assume one based on the other.
242
+
243
+ If something affects your whole application and is either used directly in the
244
+ Ramaze module or throughout the framework it is considered to be put into Global
245
+ to gain benefits of better documentation and accessibility.
246
+
247
+ On the other hand - if something is used in a configuring manner by a class that
248
+ is instantiated often (like Controller is for example), or a module that cannot
249
+ hold instance variables in a nice manner and is also not a constant - then it is
250
+ configured using traits.
251
+
252
+
253
+ Ramaze
254
+ Global
255
+ Adapter
256
+ Dispatcher
257
+ Controller
258
+ Action
259
+
260
+ Session
261
+ Helper
262
+ Tool
263
+
264
+
265
+ #### The Web
266
+
267
+ The so called web consists of a plethora of data, most of it is browsable
268
+ through a web browser that just about every toaster has installed these days.
269
+ The browser is the target of a web author, trying to utilize common standards
270
+ like HTML and CSS which are means for data and layout to be combined, giving the
271
+ browser a way to display the data.
272
+ Ramaze works on the URI-scale web, meaning that addresses like
273
+ http://someserver.com/blog/article/1 have a unique representation on your
274
+ server.
275
+ If we stay with this example, we see already everything Ramaze needs to see to
276
+ serve a page based on your instructions.
277
+ We assume that blog/article is a Controller named ArticleController in the blog
278
+ application.