ramaze 0.3.9.1 → 2008.06

Sign up to get free protection for your applications and to get access to all the features.
Files changed (400) hide show
  1. data/{doc/README → README.markdown} +78 -32
  2. data/Rakefile +53 -50
  3. data/benchmark/results.txt +131 -0
  4. data/benchmark/run.rb +362 -0
  5. data/benchmark/suite/minimal.rb +13 -0
  6. data/benchmark/suite/no_informer.rb +9 -0
  7. data/benchmark/suite/no_sessions.rb +10 -0
  8. data/benchmark/suite/no_template.rb +9 -0
  9. data/benchmark/suite/simple.rb +7 -0
  10. data/benchmark/suite/template_amrita2.rb +17 -0
  11. data/benchmark/suite/template_builder.rb +12 -0
  12. data/benchmark/suite/template_erubis.rb +10 -0
  13. data/benchmark/suite/template_ezamar.rb +10 -0
  14. data/benchmark/suite/template_haml.rb +15 -0
  15. data/benchmark/suite/template_liquid.rb +13 -0
  16. data/benchmark/suite/template_markaby.rb +11 -0
  17. data/benchmark/suite/template_nagoro.rb +10 -0
  18. data/benchmark/suite/template_redcloth.rb +15 -0
  19. data/benchmark/suite/template_tenjin.rb +10 -0
  20. data/benchmark/test.rb +35 -0
  21. data/bin/ramaze +32 -122
  22. data/cache.yaml +7 -0
  23. data/doc/AUTHORS +26 -22
  24. data/doc/CHANGELOG +16720 -3907
  25. data/doc/INSTALL +77 -19
  26. data/doc/LEGAL +0 -4
  27. data/doc/meta/announcement.txt +43 -54
  28. data/doc/meta/configuration.txt +3 -2
  29. data/doc/readme_chunks/examples.txt +2 -2
  30. data/doc/readme_chunks/installing.txt +66 -20
  31. data/doc/tutorial/todolist.html +338 -520
  32. data/doc/tutorial/todolist.mkd +36 -2
  33. data/examples/{auth → app/auth}/auth.rb +0 -0
  34. data/examples/{auth → app/auth}/template/layout.haml +0 -0
  35. data/examples/{auth → app/auth}/template/login.haml +0 -0
  36. data/examples/{blog → app/blog}/README +0 -0
  37. data/examples/{blog → app/blog}/controller/main.rb +1 -1
  38. data/examples/{blog → app/blog}/model/entry.rb +1 -1
  39. data/examples/{blog → app/blog}/public/styles/blog.css +0 -0
  40. data/examples/{blog → app/blog}/spec/blog.rb +2 -2
  41. data/examples/{blog → app/blog}/start.rb +0 -0
  42. data/examples/{blog → app/blog}/view/edit.xhtml +0 -0
  43. data/examples/{blog → app/blog}/view/index.xhtml +0 -0
  44. data/examples/{blog → app/blog}/view/layout.xhtml +0 -0
  45. data/examples/{blog → app/blog}/view/new.xhtml +0 -0
  46. data/examples/app/chat/model/history.rb +36 -0
  47. data/examples/app/chat/model/message.rb +7 -0
  48. data/examples/app/chat/public/css/chat.css +13 -0
  49. data/examples/app/chat/public/js/chat.js +22 -0
  50. data/examples/app/chat/public/js/jquery.js +3436 -0
  51. data/examples/app/chat/start.rb +40 -0
  52. data/examples/app/chat/view/chat.xhtml +9 -0
  53. data/examples/app/chat/view/index.xhtml +7 -0
  54. data/examples/app/chat/view/layout.xhtml +13 -0
  55. data/examples/app/localization/start.rb +35 -0
  56. data/examples/{rammit → app/rammit}/spec/rammit.rb +2 -1
  57. data/examples/{rammit → app/rammit}/src/controller/main.rb +0 -0
  58. data/examples/{rammit → app/rammit}/src/controller/page.rb +0 -0
  59. data/examples/{rammit → app/rammit}/src/model.rb +0 -0
  60. data/examples/{rammit → app/rammit}/start.rb +0 -0
  61. data/examples/{rammit → app/rammit}/template/index.xhtml +0 -0
  62. data/examples/{rammit → app/rammit}/template/page/view.xhtml +0 -0
  63. data/examples/{rapaste → app/rapaste}/Rakefile +0 -1
  64. data/examples/{rapaste → app/rapaste}/controller/paste.rb +3 -3
  65. data/examples/{rapaste → app/rapaste}/model/paste.rb +0 -0
  66. data/examples/{rapaste → app/rapaste}/public/css/active4d.css +0 -0
  67. data/examples/{rapaste → app/rapaste}/public/css/all_hallows_eve.css +0 -0
  68. data/examples/{rapaste → app/rapaste}/public/css/amy.css +0 -0
  69. data/examples/{rapaste → app/rapaste}/public/css/blackboard.css +0 -0
  70. data/examples/{rapaste → app/rapaste}/public/css/brilliance_black.css +0 -0
  71. data/examples/{rapaste → app/rapaste}/public/css/brilliance_dull.css +0 -0
  72. data/examples/{rapaste → app/rapaste}/public/css/cobalt.css +0 -0
  73. data/examples/{rapaste → app/rapaste}/public/css/dawn.css +0 -0
  74. data/examples/{rapaste → app/rapaste}/public/css/display.css +0 -0
  75. data/examples/{rapaste → app/rapaste}/public/css/eiffel.css +0 -0
  76. data/examples/{rapaste → app/rapaste}/public/css/espresso_libre.css +0 -0
  77. data/examples/{rapaste → app/rapaste}/public/css/idle.css +0 -0
  78. data/examples/{rapaste → app/rapaste}/public/css/iplastic.css +0 -0
  79. data/examples/{rapaste → app/rapaste}/public/css/lazy.css +0 -0
  80. data/examples/{rapaste → app/rapaste}/public/css/mac_classic.css +0 -0
  81. data/examples/{rapaste → app/rapaste}/public/css/magicwb_amiga.css +0 -0
  82. data/examples/{rapaste → app/rapaste}/public/css/pastels_on_dark.css +0 -0
  83. data/examples/{rapaste → app/rapaste}/public/css/slush_poppies.css +0 -0
  84. data/examples/{rapaste → app/rapaste}/public/css/spacecadet.css +0 -0
  85. data/examples/{rapaste → app/rapaste}/public/css/sunburst.css +0 -0
  86. data/examples/{rapaste → app/rapaste}/public/css/twilight.css +0 -0
  87. data/examples/{rapaste → app/rapaste}/public/css/zenburnesque.css +0 -0
  88. data/examples/{rapaste → app/rapaste}/public/js/jquery.js +0 -0
  89. data/examples/{rapaste → app/rapaste}/spec/rapaste.rb +2 -2
  90. data/examples/{rapaste → app/rapaste}/start.rb +0 -0
  91. data/examples/{rapaste → app/rapaste}/view/copy.xhtml +0 -0
  92. data/examples/{rapaste → app/rapaste}/view/index.xhtml +0 -0
  93. data/examples/{rapaste → app/rapaste}/view/layout.xhtml +0 -0
  94. data/examples/{rapaste → app/rapaste}/view/list.xhtml +0 -0
  95. data/examples/{rapaste → app/rapaste}/view/search.xhtml +0 -0
  96. data/examples/{rapaste → app/rapaste}/view/view.xhtml +0 -0
  97. data/examples/{sourceview → app/sourceview}/public/coderay.css +0 -0
  98. data/examples/{sourceview → app/sourceview}/public/images/file.gif +0 -0
  99. data/examples/{sourceview → app/sourceview}/public/images/folder.gif +0 -0
  100. data/examples/{sourceview → app/sourceview}/public/images/tv-collapsable-last.gif +0 -0
  101. data/examples/{sourceview → app/sourceview}/public/images/tv-collapsable.gif +0 -0
  102. data/examples/{sourceview → app/sourceview}/public/images/tv-expandable-last.gif +0 -0
  103. data/examples/{sourceview → app/sourceview}/public/images/tv-expandable.gif +0 -0
  104. data/examples/{sourceview → app/sourceview}/public/images/tv-item-last.gif +0 -0
  105. data/examples/{sourceview → app/sourceview}/public/images/tv-item.gif +0 -0
  106. data/examples/{sourceview → app/sourceview}/public/jquery.js +0 -0
  107. data/examples/{sourceview → app/sourceview}/public/jquery.treeview.css +0 -0
  108. data/examples/{sourceview → app/sourceview}/public/jquery.treeview.js +0 -0
  109. data/examples/{sourceview → app/sourceview}/public/sourceview.js +0 -0
  110. data/examples/{sourceview → app/sourceview}/sourceview.rb +1 -1
  111. data/examples/{sourceview → app/sourceview}/template/index.haml +0 -0
  112. data/examples/{todolist → app/todolist}/README +0 -0
  113. data/examples/{todolist → app/todolist}/public/favicon.ico +0 -0
  114. data/examples/{todolist → app/todolist}/public/js/jquery.js +0 -0
  115. data/examples/{todolist → app/todolist}/public/ramaze.png +0 -0
  116. data/examples/{todolist → app/todolist}/spec/todolist.rb +2 -2
  117. data/examples/{todolist → app/todolist}/src/controller/main.rb +0 -0
  118. data/examples/{todolist → app/todolist}/src/element/page.rb +0 -0
  119. data/examples/{todolist → app/todolist}/src/model.rb +0 -0
  120. data/examples/{todolist → app/todolist}/start.rb +0 -0
  121. data/examples/{todolist → app/todolist}/template/index.xhtml +0 -0
  122. data/examples/{todolist → app/todolist}/template/new.xhtml +0 -0
  123. data/examples/{upload → app/upload}/start.rb +0 -0
  124. data/examples/{upload → app/upload}/view/index.xhtml +0 -0
  125. data/examples/{whywiki → app/whywiki}/spec/whywiki.rb +3 -3
  126. data/examples/{whywiki → app/whywiki}/start.rb +0 -0
  127. data/examples/{whywiki → app/whywiki}/template/edit.xhtml +0 -0
  128. data/examples/{whywiki → app/whywiki}/template/show.xhtml +0 -0
  129. data/examples/{wikore → app/wikore}/spec/wikore.rb +2 -2
  130. data/examples/{wikore → app/wikore}/src/controller.rb +0 -0
  131. data/examples/{wikore → app/wikore}/src/model.rb +0 -0
  132. data/examples/{wikore → app/wikore}/start.rb +0 -0
  133. data/examples/{wikore → app/wikore}/template/index.xhtml +0 -0
  134. data/examples/{wiktacular → app/wiktacular}/README +0 -0
  135. data/examples/{wiktacular → app/wiktacular}/mkd/link/2007-07-20_19-45-51.mkd +0 -0
  136. data/examples/{wiktacular → app/wiktacular}/mkd/link/current.mkd +0 -0
  137. data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_16-31-33.mkd +0 -0
  138. data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-21-12.mkd +0 -0
  139. data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-23-10.mkd +0 -0
  140. data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-45-07.mkd +0 -0
  141. data/examples/{wiktacular → app/wiktacular}/mkd/main/current.mkd +0 -0
  142. data/examples/{wiktacular → app/wiktacular}/mkd/markdown/current.mkd +0 -0
  143. data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-20_16-43-46.mkd +0 -0
  144. data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-20_19-43-50.mkd +0 -0
  145. data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-46-01.mkd +0 -0
  146. data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-46-32.mkd +0 -0
  147. data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-47-08.mkd +0 -0
  148. data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-47-54.mkd +0 -0
  149. data/examples/{wiktacular → app/wiktacular}/mkd/testing/current.mkd +0 -0
  150. data/examples/{wiktacular → app/wiktacular}/public/favicon.ico +0 -0
  151. data/examples/{wiktacular → app/wiktacular}/public/screen.css +0 -0
  152. data/examples/{wiktacular → app/wiktacular}/spec/wiktacular.rb +4 -5
  153. data/examples/{wiktacular → app/wiktacular}/src/controller.rb +0 -0
  154. data/examples/{wiktacular → app/wiktacular}/src/model.rb +0 -0
  155. data/examples/{wiktacular → app/wiktacular}/start.rb +0 -0
  156. data/examples/{wiktacular → app/wiktacular}/template/edit.xhtml +0 -0
  157. data/examples/{wiktacular → app/wiktacular}/template/html_layout.xhtml +0 -0
  158. data/examples/{wiktacular → app/wiktacular}/template/index.xhtml +0 -0
  159. data/examples/{wiktacular → app/wiktacular}/template/new.xhtml +0 -0
  160. data/examples/{element.rb → basic/element.rb} +0 -0
  161. data/examples/basic/gestalt.rb +27 -0
  162. data/examples/{hello.rb → basic/hello.rb} +0 -0
  163. data/examples/{layout.rb → basic/layout.rb} +0 -0
  164. data/examples/{linking.rb → basic/linking.rb} +0 -0
  165. data/examples/{simple.rb → basic/simple.rb} +3 -3
  166. data/examples/{caching.rb → helpers/cache.rb} +0 -0
  167. data/examples/helpers/form_with_sequel.rb +24 -0
  168. data/examples/helpers/httpdigest.rb +50 -0
  169. data/examples/{identity.rb → helpers/identity.rb} +0 -0
  170. data/examples/{nitro_form.rb → helpers/nitro_form.rb} +0 -0
  171. data/examples/helpers/provide.rb +23 -0
  172. data/examples/helpers/rest.rb +28 -0
  173. data/examples/helpers/simple_captcha.rb +29 -0
  174. data/examples/{css.rb → misc/css.rb} +0 -0
  175. data/examples/{facebook.rb → misc/facebook.rb} +0 -0
  176. data/examples/{memleak_detector.rb → misc/memleak_detector.rb} +0 -0
  177. data/examples/misc/nagoro_element.rb +43 -0
  178. data/examples/{ramaise.rb → misc/ramaise.rb} +0 -0
  179. data/examples/misc/rapp.rb +45 -0
  180. data/examples/misc/sequel_scaffolding.rb +34 -0
  181. data/examples/{simple_auth.rb → misc/simple_auth.rb} +0 -0
  182. data/examples/templates/template_amrita2.rb +1 -1
  183. data/examples/templates/template_erubis.rb +2 -2
  184. data/examples/templates/template_ezamar.rb +1 -1
  185. data/examples/templates/template_haml.rb +2 -2
  186. data/examples/templates/template_liquid.rb +2 -2
  187. data/examples/templates/template_markaby.rb +1 -1
  188. data/examples/templates/template_nagoro.rb +1 -1
  189. data/examples/templates/template_redcloth.rb +2 -2
  190. data/examples/templates/template_remarkably.rb +1 -1
  191. data/examples/templates/template_tenjin.rb +5 -9
  192. data/examples/templates/template_xslt.rb +1 -1
  193. data/lib/proto/public/dispatch.fcgi +0 -0
  194. data/lib/proto/public/js/jquery.js +750 -577
  195. data/lib/proto/spec/main.rb +1 -1
  196. data/lib/proto/start.ru +8 -0
  197. data/lib/proto/view/page.xhtml +13 -1
  198. data/lib/ramaze.rb +32 -15
  199. data/lib/ramaze/action.rb +18 -1
  200. data/lib/ramaze/action/render.rb +45 -17
  201. data/lib/ramaze/adapter.rb +8 -7
  202. data/lib/ramaze/adapter/base.rb +79 -13
  203. data/lib/ramaze/adapter/cgi.rb +5 -10
  204. data/lib/ramaze/adapter/ebb.rb +6 -20
  205. data/lib/ramaze/adapter/fake.rb +12 -0
  206. data/lib/ramaze/adapter/fcgi.rb +5 -11
  207. data/lib/ramaze/adapter/lsws.rb +5 -9
  208. data/lib/ramaze/adapter/mongrel.rb +5 -9
  209. data/lib/ramaze/adapter/scgi.rb +4 -8
  210. data/lib/ramaze/adapter/thin.rb +6 -11
  211. data/lib/ramaze/adapter/webrick.rb +13 -22
  212. data/lib/ramaze/cache.rb +36 -10
  213. data/lib/ramaze/cache/memcached.rb +3 -2
  214. data/lib/ramaze/contrib.rb +1 -1
  215. data/lib/ramaze/contrib/email.rb +1 -1
  216. data/lib/ramaze/contrib/file_cache.rb +1 -1
  217. data/lib/ramaze/contrib/gems.rb +79 -0
  218. data/lib/ramaze/contrib/gettext/po.rb +0 -0
  219. data/lib/ramaze/contrib/profiling.rb +1 -1
  220. data/lib/ramaze/contrib/rest.rb +14 -0
  221. data/lib/ramaze/controller.rb +45 -12
  222. data/lib/ramaze/controller/error.rb +4 -4
  223. data/lib/ramaze/controller/resolve.rb +61 -42
  224. data/lib/ramaze/current.rb +2 -2
  225. data/lib/ramaze/current/request.rb +25 -2
  226. data/lib/ramaze/current/response.rb +8 -0
  227. data/lib/ramaze/current/session.rb +64 -36
  228. data/lib/ramaze/current/session/flash.rb +14 -2
  229. data/lib/ramaze/current/session/hash.rb +3 -2
  230. data/lib/ramaze/dispatcher.rb +25 -12
  231. data/lib/ramaze/dispatcher/action.rb +12 -3
  232. data/lib/ramaze/dispatcher/directory.rb +4 -1
  233. data/lib/ramaze/dispatcher/error.rb +3 -3
  234. data/lib/ramaze/dispatcher/file.rb +11 -3
  235. data/lib/ramaze/gestalt.rb +1 -1
  236. data/lib/ramaze/helper.rb +17 -21
  237. data/lib/ramaze/helper/aspect.rb +20 -14
  238. data/lib/ramaze/helper/auth.rb +1 -1
  239. data/lib/ramaze/helper/cache.rb +3 -6
  240. data/lib/ramaze/helper/cgi.rb +6 -2
  241. data/lib/ramaze/helper/flash.rb +7 -7
  242. data/lib/ramaze/helper/form.rb +281 -0
  243. data/lib/ramaze/helper/formatting.rb +76 -0
  244. data/lib/ramaze/helper/gestalt.rb +15 -0
  245. data/lib/ramaze/helper/gravatar.rb +15 -0
  246. data/lib/ramaze/helper/httpdigest.rb +48 -0
  247. data/lib/ramaze/helper/identity.rb +87 -62
  248. data/lib/ramaze/helper/partial.rb +11 -2
  249. data/lib/ramaze/helper/redirect.rb +12 -3
  250. data/lib/ramaze/helper/rest.rb +43 -0
  251. data/lib/ramaze/helper/sendfile.rb +1 -3
  252. data/lib/ramaze/helper/sequel.rb +3 -0
  253. data/lib/ramaze/helper/simple_captcha.rb +31 -0
  254. data/lib/ramaze/helper/stack.rb +14 -5
  255. data/lib/ramaze/helper/user.rb +86 -34
  256. data/lib/ramaze/helper/xhtml.rb +23 -0
  257. data/lib/ramaze/log.rb +1 -2
  258. data/lib/ramaze/log/analogger.rb +24 -19
  259. data/lib/ramaze/log/growl.rb +24 -19
  260. data/lib/ramaze/log/hub.rb +25 -22
  261. data/lib/ramaze/log/informer.rb +104 -99
  262. data/lib/ramaze/log/knotify.rb +17 -12
  263. data/lib/ramaze/log/logger.rb +14 -8
  264. data/lib/ramaze/log/logging.rb +63 -60
  265. data/lib/ramaze/log/syslog.rb +24 -19
  266. data/lib/ramaze/log/xosd.rb +77 -71
  267. data/lib/ramaze/option.rb +153 -0
  268. data/lib/ramaze/option/dsl.rb +45 -0
  269. data/lib/ramaze/option/holder.rb +153 -0
  270. data/lib/ramaze/option/merger.rb +108 -0
  271. data/lib/ramaze/route.rb +15 -2
  272. data/lib/ramaze/setup.rb +50 -0
  273. data/lib/ramaze/snippets/binding/locals.rb +1 -1
  274. data/lib/ramaze/snippets/dictionary.rb +3 -3
  275. data/lib/ramaze/snippets/divide.rb +7 -7
  276. data/lib/ramaze/snippets/kernel/__dir__.rb +1 -1
  277. data/lib/ramaze/snippets/kernel/acquire.rb +0 -5
  278. data/lib/ramaze/snippets/metaid.rb +1 -1
  279. data/lib/ramaze/snippets/numeric/filesize_format.rb +11 -5
  280. data/lib/ramaze/snippets/object/instance_variable_defined.rb +8 -0
  281. data/lib/ramaze/snippets/object/scope.rb +1 -1
  282. data/lib/ramaze/snippets/object/thread_accessor.rb +1 -1
  283. data/lib/ramaze/snippets/ordered_set.rb +5 -1
  284. data/lib/ramaze/snippets/ramaze/deprecated.rb +7 -0
  285. data/lib/ramaze/snippets/ramaze/thread_accessor.rb +15 -1
  286. data/lib/ramaze/snippets/string/esc.rb +2 -2
  287. data/lib/ramaze/snippets/string/start_with.rb +1 -0
  288. data/lib/ramaze/snippets/string/unindent.rb +9 -1
  289. data/lib/ramaze/snippets/struct/values_at.rb +17 -1
  290. data/lib/ramaze/snippets/thread/into.rb +1 -1
  291. data/lib/ramaze/sourcereload.rb +83 -76
  292. data/lib/ramaze/spec/helper.rb +39 -26
  293. data/lib/ramaze/spec/helper/bacon.rb +5 -5
  294. data/lib/ramaze/spec/helper/mock_http.rb +1 -7
  295. data/lib/ramaze/spec/helper/pretty_output.rb +10 -2
  296. data/lib/ramaze/spec/helper/requester.rb +14 -0
  297. data/lib/ramaze/template.rb +6 -3
  298. data/lib/ramaze/template/amrita2.rb +1 -0
  299. data/lib/ramaze/template/erubis.rb +7 -1
  300. data/lib/ramaze/template/ezamar/render_partial.rb +1 -1
  301. data/lib/ramaze/template/nagoro.rb +1 -0
  302. data/lib/ramaze/template/redcloth.rb +1 -0
  303. data/lib/ramaze/template/tagz.rb +8 -8
  304. data/lib/ramaze/template/tenjin.rb +42 -2
  305. data/lib/ramaze/template/xslt.rb +4 -0
  306. data/lib/ramaze/tool/daemonize.rb +37 -0
  307. data/lib/ramaze/tool/localize.rb +142 -106
  308. data/lib/ramaze/version.rb +2 -10
  309. data/rake_tasks/conf.rake +11 -13
  310. data/rake_tasks/gem.rake +59 -37
  311. data/rake_tasks/git.rake +41 -0
  312. data/rake_tasks/maintenance.rake +263 -299
  313. data/rake_tasks/release.rake +63 -0
  314. data/rake_tasks/spec.rake +1 -1
  315. data/ramaze.gemspec +731 -0
  316. data/spec/contrib/profiling.rb +5 -2
  317. data/spec/examples/caching.rb +1 -1
  318. data/spec/examples/css.rb +1 -1
  319. data/spec/examples/element.rb +1 -1
  320. data/spec/examples/hello.rb +1 -1
  321. data/spec/examples/linking.rb +1 -1
  322. data/spec/examples/simple.rb +1 -1
  323. data/spec/examples/simple_auth.rb +1 -1
  324. data/spec/ramaze/action/cache.rb +58 -14
  325. data/spec/ramaze/action/file_cache.rb +48 -0
  326. data/spec/ramaze/action/layout.rb +2 -2
  327. data/spec/ramaze/action/render.rb +1 -2
  328. data/spec/ramaze/action/{template → view}/bar.xhtml +0 -0
  329. data/spec/ramaze/action/{template → view}/instancevars/layout.xhtml +0 -0
  330. data/spec/ramaze/action/{template → view}/other_wrapper.xhtml +0 -0
  331. data/spec/ramaze/action/{template → view}/single_wrapper.xhtml +0 -0
  332. data/spec/ramaze/action/{template → view}/sub/sub_wrapper.xhtml +0 -0
  333. data/spec/ramaze/adapter.rb +29 -2
  334. data/spec/ramaze/adapter/ebb.rb +12 -0
  335. data/spec/ramaze/cache.rb +82 -15
  336. data/spec/ramaze/controller.rb +6 -3
  337. data/spec/ramaze/controller/actionless_templates.rb +2 -2
  338. data/spec/ramaze/controller/resolve.rb +1 -1
  339. data/spec/ramaze/controller/template_resolving.rb +4 -6
  340. data/spec/ramaze/controller/{template → view}/greet.xhtml +0 -0
  341. data/spec/ramaze/controller/{template → view}/list.xhtml +0 -0
  342. data/spec/ramaze/controller/{template → view}/other/greet/other.xhtml +0 -0
  343. data/spec/ramaze/controller/{template → view}/other_wrapper.xhtml +0 -0
  344. data/spec/ramaze/error.rb +1 -1
  345. data/spec/ramaze/helper/aspect.rb +4 -4
  346. data/spec/ramaze/helper/cache.rb +56 -39
  347. data/spec/ramaze/helper/flash.rb +14 -1
  348. data/spec/ramaze/helper/form.rb +118 -0
  349. data/spec/ramaze/helper/formatting.rb +21 -0
  350. data/spec/ramaze/helper/link.rb +2 -2
  351. data/spec/ramaze/helper/pager.rb +2 -2
  352. data/spec/ramaze/helper/partial.rb +13 -1
  353. data/spec/ramaze/helper/simple_captcha.rb +22 -0
  354. data/spec/ramaze/helper/user.rb +7 -10
  355. data/spec/ramaze/helper/{template → view}/locals.xhtml +0 -0
  356. data/spec/ramaze/helper/{template → view}/loop.xhtml +0 -0
  357. data/spec/ramaze/helper/{template → view}/num.xhtml +0 -0
  358. data/spec/ramaze/helper/{template → view}/partial.xhtml +0 -0
  359. data/spec/ramaze/helper/{template → view}/recursive.xhtml +0 -0
  360. data/spec/ramaze/helper/{template → view}/recursive_local_ivars.xhtml +0 -0
  361. data/spec/ramaze/helper/{template → view}/recursive_locals.xhtml +0 -0
  362. data/spec/ramaze/helper/{template → view}/test_template.xhtml +0 -0
  363. data/spec/ramaze/localize.rb +22 -0
  364. data/spec/ramaze/log/informer.rb +10 -10
  365. data/spec/ramaze/log/syslog.rb +1 -1
  366. data/spec/ramaze/request.rb +13 -1
  367. data/spec/ramaze/request/ebb.rb +9 -0
  368. data/spec/ramaze/rewrite.rb +36 -0
  369. data/spec/ramaze/rewrite/file.css +1 -0
  370. data/spec/ramaze/route.rb +1 -0
  371. data/spec/ramaze/template.rb +5 -5
  372. data/spec/ramaze/template/amrita2.rb +1 -1
  373. data/spec/ramaze/template/builder.rb +18 -22
  374. data/spec/ramaze/template/erubis.rb +1 -1
  375. data/spec/ramaze/template/ezamar.rb +1 -1
  376. data/spec/ramaze/template/haml.rb +2 -2
  377. data/spec/ramaze/template/liquid.rb +1 -1
  378. data/spec/ramaze/template/markaby.rb +1 -1
  379. data/spec/ramaze/template/nagoro.rb +1 -1
  380. data/spec/ramaze/template/redcloth.rb +1 -1
  381. data/spec/ramaze/template/remarkably.rb +1 -1
  382. data/spec/ramaze/template/sass.rb +1 -1
  383. data/spec/ramaze/template/tagz.rb +1 -1
  384. data/spec/ramaze/template/tenjin.rb +4 -6
  385. data/spec/ramaze/template/xslt.rb +1 -1
  386. data/spec/snippets/string/unindent.rb +6 -0
  387. data/spec/snippets/struct/values_at.rb +8 -0
  388. metadata +522 -487
  389. data/doc/ProjectInfo +0 -53
  390. data/doc/migrate/1110_to_1111.txt +0 -131
  391. data/lib/ramaze/contrib/route.rb +0 -22
  392. data/lib/ramaze/global.rb +0 -116
  393. data/lib/ramaze/global/dsl.rb +0 -39
  394. data/lib/ramaze/global/globalstruct.rb +0 -147
  395. data/lib/ramaze/helper/inform.rb +0 -40
  396. data/lib/ramaze/inform.rb +0 -4
  397. data/lib/ramaze/snippets/kernel/aquire.rb +0 -1
  398. data/lib/vendor/bacon.rb +0 -323
  399. data/rake_tasks/darcs.rake +0 -5
  400. data/spec/contrib/route.rb +0 -36
@@ -1,53 +0,0 @@
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
-
@@ -1,131 +0,0 @@
1
- = Explanation of the changes of patch 1110-1111
2
-
3
- What this patch is all about.
4
- Due to a general cleanup and preparation for further extension there has been a
5
- lot of moving of code into more appropriate positions.
6
- Another goal was the reimplementation of Global, away from OpenStruct to the
7
- faster Struct.
8
- Some smaller improvments will follow on both areas, but as with the last
9
- Controller refactoring, this aimed to be finished as soon as possible to get
10
- Ramaze bulletproof again before the next release.
11
-
12
-
13
- == Ramaze
14
- === What happened to the module
15
-
16
- The whole module has now only two methods, :startup and :shutdown
17
-
18
- startup sends .startup to the classes in
19
- Ramaze.trait[:essentials]
20
- shutdown sends .shutdown to these classes.
21
-
22
- Other methods changed:
23
-
24
- force_start
25
- removed -> not used anywhere and easily done with a passed option.
26
-
27
- execute
28
- removed -> there may be a replacement coming though.
29
-
30
- kill_threads
31
- delegated -> this is handled over the shutdown of the responsible classes now.
32
-
33
- setup_controllers
34
- delegated -> has been moved to Controller::startup
35
-
36
- init_sourcereload
37
- delegated -> moved to SourceReload::startup
38
-
39
- init_global
40
- delegated -> moved to Global::startup
41
-
42
- init_adapter, run_adapter, test_connections, connection_possible
43
- delegated -> moved to Adapter::startup
44
-
45
- require_adapter
46
- delegated -> is now the mask Global.adapter
47
-
48
- parse_port
49
- delegated -> is now the mask Global.ports
50
-
51
-
52
- == Global
53
- === New functionality and layout
54
-
55
- Global is now a Struct instead of an OpenStruct, which means two things:
56
- The general API is hardened now, assigning new accessors is not as simple as
57
- just setting them via method_missing anymore.
58
- The GlobalStruct::DEFAULT hash defines what contents the Struct has.
59
- This has on one hand a improved performance, on the other hand it unifies the
60
- API for further versions, collecting the setting of Global accessors into one
61
- place.
62
- We could add method_missing in further revisions if need arises.
63
- The other important improvement is the masking of internals of Global. This means
64
- that we can now define a method over the internal value and present something
65
- different than it actually contains. Also hooks on setting a value are now
66
- possible.
67
-
68
- Controller.trait[:ramaze_public] has moved here as Global.public_root to match
69
- the Controller.public_root setting.
70
-
71
-
72
- == Controller
73
- === template_root and public_root
74
-
75
- These are no traits anymore. Now the resolution of templates should be a little
76
- bit faster, but more importantly they will give you a warning when setting a
77
- path that does not exist.
78
- To remove the 'self.' boilerplate they take an optional argument and act as
79
- getter only if no argument is given.
80
-
81
-
82
- == Cache
83
- === Unified API for new Caches
84
-
85
- We now take advantage of the ages-old idea of having a unified Ramaze::Cache to
86
- spawn new instances of caches instead of relying on Global.cache.new which posed
87
- many problems with configuring them.
88
- To retrieve a new cache, simply use Cache.new now, setting Global.cache will
89
- define which class is used for this. You can set strings/symbols like :memory,
90
- :memcached or :yaml.
91
-
92
- Cache also specifies a unified API, at the moment consisting of:
93
- #[](key), #[]=(key, value), #clear, #delete(*keys)
94
-
95
- To make interacting easier, all keys are stored/retrieved as strings
96
- automatically so you can use either symbols or strings to access values.
97
-
98
-
99
- == Adapter
100
- === Adapter::( startup | shutdown )
101
-
102
- The stuff from Ramaze has moved here, it basically still works the same way.
103
- However, we are now wrapping less threads around one adapter, which may or may
104
- not affect performance.
105
-
106
-
107
- == Request
108
- === Outsourcing of methods to Rack
109
-
110
- Following methods have been moved to the latest version of Rack:
111
- #fullpath #[](key), #[]=(key, value), #values_at(*keys), #referer/#referer
112
-
113
- === Change from module to subclass
114
-
115
- == Response
116
- === Change from module to subclass
117
-
118
- Same as Request
119
-
120
-
121
- == STATUS_CODE
122
- === Usage of Rack::Utils::HTTP_STATUS_CODES
123
-
124
- We are now using the hash from Rack, assigned to Ramaze::STATUS_CODE and have
125
- removed ramaze/http_status.rb
126
- The major change is that the keys are now strings like
127
- "Not Found" or "Internal Server Error". Most of the time guessing will work.
128
-
129
-
130
- == Informing
131
- === Added #debug? for WEBrick, set to false.
@@ -1,22 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
- module Ramaze
5
- module Contrib
6
- class Route
7
- class << self
8
- def startup
9
- warn "Ramaze::Contrib::Route is being deprecated, use Ramaze::Route instead"
10
- end
11
-
12
- def [](key)
13
- Ramaze::Route.trait[:routes][key]
14
- end
15
-
16
- def []=(key, value)
17
- Ramaze::Route.trait[:routes][key] = value
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,116 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
- require 'ramaze/global/dsl'
5
-
6
- module Ramaze
7
- GlobalDSL.option_dsl do
8
- o "Set the adapter Ramaze will run on.",
9
- :adapter => :webrick, :cli => [:webrick, :mongrel, :thin]
10
-
11
- o "Set the size of Backtrace shown.",
12
- :backtrace_size => 10, :cli => 10
13
-
14
- o "Turn benchmarking every request on.",
15
- :benchmarking => false, :cli => false, :short => :b
16
-
17
- o "Do not log about these requests to static files, values as in Global.ignore",
18
- # Example: [/\.(ico|gif|jpg|png)$/, '/robots.txt']
19
- :boring => [ '/favicon.ico' ]
20
-
21
- o "Use this for general caching and as base for Cache.new.",
22
- :cache => :memory, :cli => [:memory, :memcached, :yaml]
23
-
24
- o "Alternative caches",
25
- :cache_alternative => {}
26
-
27
- o "Turn on naive caching of all requests.",
28
- :cache_all => false, :cli => false
29
-
30
- o "Compile Templates",
31
- :compile => false, :cli => false
32
-
33
- o "Active contribs ",
34
- :contribs => Set.new
35
-
36
- o "All subclasses of Controller are collected here.",
37
- :controllers => Set.new
38
-
39
- o "Start Ramaze within an IRB session",
40
- :console => false, :cli => false, :short => :c
41
-
42
- o "Turn on customized error pages.",
43
- :error_page => true, :cli => true
44
-
45
- o "Caching actions to the filesystem in Global.public_root",
46
- :file_cache => false, :cli => false
47
-
48
- o "Specify what IP Ramaze will respond to - 0.0.0.0 for all",
49
- :host => "0.0.0.0", :cli => '0.0.0.0'
50
-
51
- o "Ignore requests to these paths if no file in public_root exists, absolute path or regex",
52
- # Example: [/\.(ico|gif|jpg|png)$/, '/robots.txt']
53
- :ignore => [ '/favicon.ico' ]
54
-
55
- o "Body set on ignored paths",
56
- :ignore_body => "File not found"
57
-
58
- o "Status set on ignored paths",
59
- :ignore_status => 404
60
-
61
- o "Templating engines to load on startup",
62
- :load_engines => []
63
-
64
- o "All paths to controllers are mapped here.",
65
- :mapping => {}
66
-
67
- o "For your own modes to decide on",
68
- :mode => :live, :cli => [:live, :dev]
69
-
70
- o "The place ramaze was started from, useful mostly for debugging",
71
- :origin => :main
72
-
73
- o "Specify port",
74
- :port => 7000, :cli => 7000, :short => :p
75
-
76
- o "Specify directory to serve static files",
77
- :public_root => 'public', :cli => 'public'
78
-
79
- o "Record all Request objects by assigning a filtering Proc to me.",
80
- :record => false
81
-
82
- o "Don't wait until all adapter-threads are finished or killed.",
83
- :run_loose => false, :cli => false
84
-
85
- o "The running server will be put here from Adapter.",
86
- :server => nil
87
-
88
- o "Turn on session for all requests.",
89
- :sessions => true, :cli => true
90
-
91
- o "Turn on BF/DoS protection for error-responses",
92
- :shield => false, :cli => false
93
-
94
- o "What signal to trap to call Ramaze::shutdown",
95
- :shutdown_trap => "SIGINT"
96
-
97
- o "Interval in seconds of the background SourceReload",
98
- :sourcereload => 3, :cli => 3
99
-
100
- o "Test before start if adapters will be able to connect",
101
- :test_connections => true, :cli => true
102
-
103
- o "Specify directory to serve dynamic files",
104
- :template_root => 'view', :cli => 'view'
105
-
106
- o "Enable directory listing",
107
- :list_directories => false, :cli => false
108
-
109
- o "Disable templates without actions",
110
- :actionless_templates => true, :cli => true
111
- end
112
-
113
- require 'ramaze/global/globalstruct'
114
-
115
- Global = GlobalStruct.setup(OPTIONS) unless defined?(Global)
116
- end
@@ -1,39 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
- module Ramaze
5
- CLIOption = Struct.new('CLIOption', :name, :default, :doc, :cli, :short)
6
- OPTIONS = {}
7
- CLI_OPTIONS = []
8
-
9
- # DSL for specifying Globap options before initializing Global
10
-
11
- module GlobalDSL
12
- class << self
13
-
14
- # The method that takes the block containing the DSL, used like in
15
- # lib/ramaze/global.rb
16
-
17
- def option_dsl(&block)
18
- instance_eval(&block)
19
- end
20
-
21
- # Takes a doc-string and then the option as hash, another :cli key can
22
- # be given that will expose this option via the bin/ramaze.
23
-
24
- def o(doc, options = {})
25
- cli_given = options.has_key?(:cli)
26
- cli = options.delete(:cli)
27
- short = options.delete(:short)
28
- name, default = options.to_a.flatten
29
-
30
- if cli_given
31
- option = CLIOption.new(name, default, doc, cli, short)
32
- CLI_OPTIONS << option
33
- end
34
-
35
- OPTIONS.merge!(options)
36
- end
37
- end
38
- end
39
- end
@@ -1,147 +0,0 @@
1
- # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
- # All files in this distribution are subject to the terms of the Ruby license.
3
-
4
- module Ramaze
5
- unless defined?(GlobalStruct) # prevent problems for SourceReload
6
- class GlobalStruct < Struct.new('Global', *OPTIONS.keys)
7
- end
8
- end
9
-
10
- # Class for Ramaze::Global instance.
11
- class GlobalStruct
12
-
13
- ENV_TRIGGER = {
14
- 'EVENT' => lambda{ require 'ramaze/adapter/evented_mongrel' },
15
- 'SWIFT' => lambda{ require 'ramaze/adapter/swiftiplied_mongrel' }
16
- }
17
-
18
- # mapping of :adapter => to the right class-name.
19
- ADAPTER_ALIAS = {
20
- :cgi => :Cgi,
21
- :fcgi => :Fcgi,
22
- :scgi => :Scgi,
23
- :thin => :Thin,
24
- :ebb => :Ebb,
25
- :lsws => :Lsws,
26
- :webrick => :WEBrick,
27
- :mongrel => :Mongrel,
28
- :evented_mongrel => :Mongrel,
29
- :swiftiplied_mongrel => :Mongrel,
30
- }
31
-
32
- # mapping of :cache => to the right class-name.
33
- CACHE_ALIAS = {
34
- :memcached => :MemcachedCache,
35
- :memory => :MemoryCache,
36
- :yaml => :YAMLStoreCache,
37
- }
38
-
39
- class << self
40
- alias setup fill
41
- end
42
-
43
- # Called from Ramaze::start, sets all the options.
44
- def startup(options = {})
45
- options.each do |key, value|
46
- if (method(key) rescue false)
47
- send("#{key}=", value)
48
- else
49
- create_member(key, value)
50
- end
51
- end
52
-
53
- ENV_TRIGGER.values_at(*ENV.keys).compact.each{|l| l.call}
54
-
55
- engines = self[:load_engines]
56
- (Symbol === engines ? [engines] : engines).each do |engine|
57
- Ramaze::Template.const_get(engine)
58
- end
59
- end
60
-
61
- # batch-assignment of key/value from hash, yields self if a block is given.
62
- def setup(hash = {})
63
- hash.each do |key, value|
64
- self.send("#{key}=", value)
65
- end
66
- yield(self) if block_given?
67
- end
68
-
69
-
70
- # Object wraps
71
-
72
- # get right classname, require the file for given adapter and answer with
73
- # the actual class.
74
- def adapter
75
- if internal = self[:adapter]
76
- class_name = ADAPTER_ALIAS.fetch(internal.to_sym, internal)
77
- unless Ramaze::Adapter.const_defined?(class_name)
78
- require("ramaze/adapter"/internal.to_s.downcase)
79
- end
80
- Ramaze::Adapter.const_get(class_name)
81
- end
82
- end
83
-
84
- # get right classname, require the file for given cache and answer with
85
- # the actual class.
86
- def cache
87
- cache_name = self[:cache].to_sym
88
- class_name = CACHE_ALIAS[cache_name] || cache_name
89
- cache = Ramaze.const_get(class_name)
90
- end
91
-
92
- # reassigns the interval in the instance of SourceReload that is running or
93
- # just waiting.
94
- def sourcereload=(interval)
95
- self[:sourcereload] = interval
96
- sri = Thread.main[:sourcereload]
97
- sri.interval = interval if sri
98
- end
99
-
100
- def template_root
101
- [ tr = self[:template_root],
102
- APPDIR/tr,
103
- APPDIR/'template',
104
- ].find{|path| File.directory?(path) } || self[:template_root]
105
- end
106
-
107
- def public_root
108
- [ pr = self[:public_root],
109
- APPDIR/pr,
110
- ].find{|path| File.directory?(path) } || self[:public_root]
111
- end
112
-
113
- def list_directories=(active)
114
- require 'ramaze/dispatcher'
115
- d = Ramaze::Dispatcher
116
- self[:list_directories] = active
117
- if active
118
- d::FILTER.put_within(d::Directory, :after => d::File, :before => d::Action)
119
- else
120
- d::FILTER.delete(d::Directory)
121
- end
122
- end
123
-
124
-
125
- # External helpers
126
-
127
- # Answers with values for given keys by sending each to self
128
- def values_at(*keys)
129
- keys.map{|key| __send__(key)}
130
- end
131
-
132
- # Creates a new attr_accessor like method-pair.
133
- def create_member key, value = nil
134
- Log.warn "Create #{key}=#{value.inspect} on Global"
135
-
136
- @table ||= {}
137
- key = key.to_sym
138
-
139
- (class << self; self; end).class_eval do
140
- define_method(key){ @table[key] }
141
- define_method("#{key}="){|val| @table[key] = val }
142
- end
143
-
144
- @table[key] = value
145
- end
146
- end
147
- end