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
@@ -4,19 +4,25 @@
4
4
  require 'logger'
5
5
 
6
6
  module Ramaze
7
+ module Logging
8
+ module Logger
7
9
 
8
- # Informer for the Stdlib Logger
10
+ # Informer for the Stdlib Logger
9
11
 
10
- class Logger < ::Logger
12
+ class Logger < ::Logger
11
13
 
12
- # integration to Logging
14
+ # integration to Logging
13
15
 
14
- def log(tag, *args)
15
- __send__(tag, args.join("\n"))
16
- end
16
+ def log(tag, *args)
17
+ __send__(tag, args.join("\n"))
18
+ end
19
+
20
+ # Stub for compatibility
21
+ def dev(*args)
22
+ debug(*args)
23
+ end
24
+ end
17
25
 
18
- def dev(*args)
19
- debug(*args)
20
26
  end
21
27
  end
22
28
  end
@@ -2,87 +2,90 @@
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
4
  module Ramaze
5
-
6
- # This module provides a basic skeleton for your own loggers to be compatible.
7
- # The minimal usage is like this:
8
- #
9
- # class MyLogger
10
- # include Logging
11
- #
12
- # def log(tag, *args)
13
- # p tag => args
14
- # end
15
- # end
16
-
17
5
  module Logging
18
6
 
19
- # Takes the tag (:warn|:debug|:error|:info) and the name of a method to be
20
- # called upon elements of msgs that don't respond to :to_str
21
- # Goes on and sends the tag and transformed messages each to the #log method.
22
- # If you include this module you have to define #log or it will raise.
23
-
24
- def tag_log(tag, meth, *msgs)
25
- msgs.each do |msg|
26
- string = (msg.respond_to?(:to_str) ? msg : msg.send(meth))
27
- log(tag, string)
7
+ # This module provides a basic skeleton for your own loggers to be compatible.
8
+ # The minimal usage is like this:
9
+ #
10
+ # class MyLogger
11
+ # include Logging
12
+ #
13
+ # def log(tag, *args)
14
+ # p tag => args
15
+ # end
16
+ # end
17
+
18
+ module Logging
19
+
20
+ # Takes the tag (:warn|:debug|:error|:info) and the name of a method to be
21
+ # called upon elements of msgs that don't respond to :to_str
22
+ # Goes on and sends the tag and transformed messages each to the #log method.
23
+ # If you include this module you have to define #log or it will raise.
24
+
25
+ def tag_log(tag, meth, *msgs)
26
+ msgs.each do |msg|
27
+ string = (msg.respond_to?(:to_str) ? msg : msg.send(meth))
28
+ log(tag, string)
29
+ end
28
30
  end
29
- end
30
31
 
31
- # Converts everything given to strings and passes them on with :info
32
+ # Converts everything given to strings and passes them on with :info
32
33
 
33
- def info(*objects)
34
- tag_log(:info, :to_s, *objects)
35
- end
34
+ def info(*objects)
35
+ tag_log(:info, :to_s, *objects)
36
+ end
36
37
 
37
- # Converts everything given to strings and passes them on with :warn
38
+ # Converts everything given to strings and passes them on with :warn
38
39
 
39
- def warn(*objects)
40
- tag_log(:warn, :to_s, *objects)
41
- end
40
+ def warn(*objects)
41
+ tag_log(:warn, :to_s, *objects)
42
+ end
42
43
 
43
- # inspects objects if they are no strings. Tag is :debug
44
+ # inspects objects if they are no strings. Tag is :debug
44
45
 
45
- def debug(*objects)
46
- tag_log(:debug, :inspect, *objects)
47
- end
46
+ def debug(*objects)
47
+ tag_log(:debug, :inspect, *objects)
48
+ end
48
49
 
49
- # inspects objects if they are no strings. Tag is :dev
50
+ # inspects objects if they are no strings. Tag is :dev
50
51
 
51
- def dev(*objects)
52
- tag_log(:dev, :inspect, *objects)
53
- end
52
+ def dev(*objects)
53
+ tag_log(:dev, :inspect, *objects)
54
+ end
54
55
 
55
- alias << debug
56
+ alias << debug
56
57
 
57
- # Takes either an Exception or just a String, formats backtraces to be a bit
58
- # more readable and passes all of this on to tag_log :error
58
+ # Takes either an Exception or just a String, formats backtraces to be a bit
59
+ # more readable and passes all of this on to tag_log :error
59
60
 
60
- def error(ex)
61
- if ex.respond_to?(:exception)
62
- message = (ex.backtrace || [])[0..Global.backtrace_size]
63
- message.map{|m| m.gsub!(/^#{Regexp.escape(Dir.pwd)}/, '.') }
64
- message.unshift(ex.inspect)
65
- else
66
- message = ex.to_s
61
+ def error(ex)
62
+ if ex.respond_to?(:exception)
63
+ message = [ex.backtrace].flatten[0..Global.backtrace_size]
64
+ message.map{|m| m.to_s.gsub(/^#{Regexp.escape(Dir.pwd)}/, '.') }
65
+ message.unshift(ex.inspect)
66
+ else
67
+ message = ex.to_s
68
+ end
69
+ tag_log(:error, :to_s, *message)
67
70
  end
68
- tag_log(:error, :to_s, *message)
69
- end
70
71
 
71
- # raises
72
+ # raises
72
73
 
73
- def log(*args)
74
- raise "#log should be implemented by an instance including this module (#{self})"
75
- end
74
+ def log(*args)
75
+ raise "#log should be implemented by an instance including this module (#{self})"
76
+ end
76
77
 
77
- # nothing
78
+ # nothing
78
79
 
79
- def shutdown
80
- end
80
+ def shutdown
81
+ end
81
82
 
82
- # stub for WEBrick
83
+ # stub for WEBrick
83
84
 
84
- def debug?
85
- false
85
+ def debug?
86
+ false
87
+ end
86
88
  end
89
+
87
90
  end
88
91
  end
@@ -4,33 +4,38 @@
4
4
  require 'syslog'
5
5
 
6
6
  module Ramaze
7
+ module Logging
8
+ module Logger
7
9
 
8
- # Informer for Syslog from rubys standard-library.
10
+ # Informer for Syslog from rubys standard-library.
9
11
 
10
- class Syslog
11
- include ::Syslog
12
+ class Syslog
13
+ include ::Syslog
12
14
 
13
- # opens syslog
15
+ # opens syslog
14
16
 
15
- def initialize
16
- open unless ::Syslog.opened?
17
- end
17
+ def initialize
18
+ open unless ::Syslog.opened?
19
+ end
18
20
 
19
- # alias for default syslog methods so they match ramaze
20
- alias error err
21
- alias warn warning
22
- alias dev debug
21
+ # alias for default syslog methods so they match ramaze
22
+ alias error err
23
+ alias warn warning
24
+ alias dev debug
23
25
 
24
- # just sends all messages received to ::Syslog
25
- def inform(tag, *args)
26
- self.__send__(tag, *args)
27
- end
26
+ # just sends all messages received to ::Syslog
27
+ def inform(tag, *args)
28
+ self.__send__(tag, *args)
29
+ end
30
+
31
+ public :error, :warn
28
32
 
29
- public :error, :warn
33
+ # Has to call the modules singleton-method.
34
+ def inspect
35
+ ::Syslog.inspect
36
+ end
37
+ end
30
38
 
31
- # Has to call the modules singleton-method.
32
- def inspect
33
- ::Syslog.inspect
34
39
  end
35
40
  end
36
41
  end
@@ -1,88 +1,94 @@
1
1
  # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
+ Ramaze::Log.log( :warn, "Both xosd gems are currently known to be broken" )
4
5
  require 'xosd'
5
6
  require 'thread'
6
7
 
7
8
  module Ramaze
9
+ module Logging
10
+ module Logger
11
+
12
+ # Informer for the XOSD notification system for X11.
13
+ #
14
+ # You can install the ruby-bindings with:
15
+ # gem install xosd.
16
+
17
+ class Xosd < ::Xosd
18
+ attr_accessor :options
19
+
20
+ include Logging
21
+
22
+ DEFAULT = {
23
+ :font_size => 20,
24
+ :font => "-*-*-*-*-*-*-%d-*-*-*-*-*-*-*",
25
+ :align => 'center',
26
+ :color => '#FFFFFF',
27
+ :lines => 3,
28
+ :valign => 'top',
29
+ :timeout => 3,
30
+ :outline_color => "#000000",
31
+ :outline_width => 1,
32
+ :vertical_offset => 20,
33
+ :colors => {
34
+ :error => "#FF0000",
35
+ :info => "#00FF00",
36
+ :warn => "#EAA61E",
37
+ :debug => "#FFFF00"
38
+ },
39
+ }
40
+
41
+ # keys to ignore when setting the options to the instance.
42
+ IGNORE = [:colors, :font_size, :lines]
43
+
44
+ # Here new messages are pushed to eventually displaying them.
45
+ QUEUE = Queue.new
46
+
47
+ # Create a new instance, valid options are in DEFAULT.
48
+ # In the background a new thread will be running that checks the QUEUE
49
+ # and processes all messages that are being sent to it.
50
+ # This is done to make output nicer and readable.
51
+
52
+ def initialize(options = {})
53
+ @options = DEFAULT.merge(options)
54
+
55
+ super(@options[:lines])
56
+
57
+ @options.each do |key, value|
58
+ next if IGNORE.include?(key)
59
+ value %= @options[:font_size] if key == :font
60
+ send("#{key}=", value)
61
+ end
8
62
 
9
- # Informer for the XOSD notification system for X11.
10
- #
11
- # You can install the ruby-bindings with:
12
- # gem install xosd.
13
-
14
- class Xosd < ::Xosd
15
- attr_accessor :options
16
-
17
- include Logging
18
-
19
- DEFAULT = {
20
- :font_size => 20,
21
- :font => "-*-*-*-*-*-*-%d-*-*-*-*-*-*-*",
22
- :align => 'center',
23
- :color => '#FFFFFF',
24
- :lines => 3,
25
- :valign => 'top',
26
- :timeout => 3,
27
- :outline_color => "#000000",
28
- :outline_width => 1,
29
- :vertical_offset => 20,
30
- :colors => {
31
- :error => "#FF0000",
32
- :info => "#00FF00",
33
- :warn => "#EAA61E",
34
- :debug => "#FFFF00"
35
- },
36
- }
37
-
38
- # keys to ignore when setting the options to the instance.
39
- IGNORE = [:colors, :font_size, :lines]
40
-
41
- # Here new messages are pushed to eventually displaying them.
42
- QUEUE = Queue.new
43
-
44
- # Create a new instance, valid options are in DEFAULT.
45
- # In the background a new thread will be running that checks the QUEUE
46
- # and processes all messages that are being sent to it.
47
- # This is done to make output nicer and readable.
48
-
49
- def initialize(options = {})
50
- @options = DEFAULT.merge(options)
51
-
52
- super(@options[:lines])
53
-
54
- @options.each do |key, value|
55
- next if IGNORE.include?(key)
56
- value %= @options[:font_size] if key == :font
57
- send("#{key}=", value)
58
- end
59
-
60
- Thread.new(self) do |xosd|
61
- loop do
62
- items = []
63
- lines = xosd.options[:lines]
64
- items << QUEUE.shift until QUEUE.empty? or items.size >= lines
65
-
66
- unless items.empty?
67
- # pad up with empty lines to avoid dragging around old messages.
68
- items << [:info, ' '] until items.size >= lines
69
-
70
- items.each_with_index do |(tag, message), i|
71
- xosd.color = xosd.options[:colors][tag.to_sym]
72
- xosd.display(message, i)
63
+ Thread.new(self) do |xosd|
64
+ loop do
65
+ items = []
66
+ lines = xosd.options[:lines]
67
+ items << QUEUE.shift until QUEUE.empty? or items.size >= lines
68
+
69
+ unless items.empty?
70
+ # pad up with empty lines to avoid dragging around old messages.
71
+ items << [:info, ' '] until items.size >= lines
72
+
73
+ items.each_with_index do |(tag, message), i|
74
+ xosd.color = xosd.options[:colors][tag.to_sym]
75
+ xosd.display(message, i)
76
+ end
77
+ end
78
+ sleep xosd.options[:timeout]
73
79
  end
74
80
  end
75
- sleep xosd.options[:timeout]
76
81
  end
77
- end
78
- end
79
82
 
80
- # pushes all messages it gets on the QUEUE for further processing.
83
+ # pushes all messages it gets on the QUEUE for further processing.
81
84
 
82
- def log(tag, *messages)
83
- messages.each do |message|
84
- QUEUE << [tag, message]
85
+ def log(tag, *messages)
86
+ messages.each do |message|
87
+ QUEUE << [tag, message]
88
+ end
89
+ end
85
90
  end
91
+
86
92
  end
87
93
  end
88
94
  end
@@ -0,0 +1,153 @@
1
+ require 'ramaze/option/dsl'
2
+ require 'ramaze/option/holder'
3
+
4
+ module Ramaze
5
+ Global = Option::Holder.new
6
+
7
+ Option::DSL.new Global do
8
+ o "List of aliases for adapters",
9
+ :adapter_aliases, {
10
+ "mongrel" => "Mongrel",
11
+ "evented_mongrel" => "Mongrel",
12
+ "fcgi" => "Fcgi",
13
+ "thin" => "Thin",
14
+ "ebb" => "Ebb",
15
+ "cgi" => "CGI",
16
+ "lsws" => "LSWS",
17
+ "scgi" => "SCGI",
18
+ "webrick" => "WEBrick",
19
+ "swiftiplied_mongrel" => "Mongrel",
20
+ }
21
+
22
+ o "Hash of aliases for caches",
23
+ :cache_aliases, {
24
+ "memory" => "MemoryCache",
25
+ "yaml" => "YAMLStoreCache",
26
+ "memcache" => "MemcachedCache",
27
+ "memcached" => "MemcachedCache",
28
+ }
29
+
30
+ o "Disable templates without actions",
31
+ :actionless_templates, true, :cli => true
32
+
33
+ o "Set adapter Ramaze will run on.",
34
+ :adapter, :webrick, :cli => @config[:adapter_aliases][1].keys, :short => :a
35
+
36
+ o "Set the size of Backtrace shown.",
37
+ :backtrace_size, 10, :cli => 10
38
+
39
+ o "Turn benchmarking every request on.",
40
+ :benchmarking, false, :short => :b, :cli => false
41
+
42
+ o "Do not log about these requests to static files, values as in Global.ignore",
43
+ :boring, ["/favicon.ico"]
44
+
45
+ o "Use this for general caching and as base for Cache.new.",
46
+ :cache, :memory, :cli => [:memory, :memcached, :yaml]
47
+
48
+ o "Turn on naive caching of all requests.",
49
+ :cache_all, false, :cli => false
50
+
51
+ o "Alternative caches",
52
+ :cache_alternative, {}
53
+
54
+ o "Don't cache action if session flash data is present for a request.",
55
+ :no_cache_flash, true, :cli => true
56
+
57
+ o "Compile Templates",
58
+ :compile, false, :cli => false
59
+
60
+ o "Start Ramaze within an IRB session",
61
+ :console, false, :short => :c
62
+
63
+ o "Active contribs",
64
+ :contribs, Set.new
65
+
66
+ o "Set default Content-Type for responses",
67
+ :content_type, "text/html"
68
+
69
+ o "Set default Accept-Charset for responses. No header set if nil.",
70
+ :accept_charset, nil
71
+
72
+ o "All subclasses of Controller are collected here.",
73
+ :controllers, Set.new
74
+
75
+ o "Instruction for daemonize, only works with bin/ramaze for now",
76
+ :daemonize, 'start', :cli => [:start, :stop]
77
+
78
+ o "Turn on customized error pages.",
79
+ :error_page, true, :cli => true
80
+
81
+ o "Caching actions to the filesystem in Global.public_root",
82
+ :file_cache, false, :cli => false
83
+
84
+ o "Specify what IP Ramaze will respond to - 0.0.0.0 for all",
85
+ :host, "0.0.0.0", :cli => "0.0.0.0"
86
+
87
+ o "Ignore requests to these paths if no file in public_root exists, absolute path or regex",
88
+ :ignore, ["/favicon.ico"]
89
+
90
+ o "Body set on ignored paths",
91
+ :ignore_body, "File not found"
92
+
93
+ o "Status set on ignored paths",
94
+ :ignore_status, 404
95
+
96
+ o "Enable directory listing",
97
+ :list_directories, false
98
+
99
+ o "Templating engines to load on startup",
100
+ :load_engines, nil
101
+
102
+ o "All paths to controllers are mapped here.",
103
+ :mapping, {}
104
+
105
+ o "Activate middleware",
106
+ :middleware, false
107
+
108
+ o "For your own modes to decide on",
109
+ :mode, :live, :cli => [:live, :dev]
110
+
111
+ o "The place ramaze was started from, useful mostly for debugging",
112
+ :origin, :main
113
+
114
+ o "Specify port",
115
+ :port, 7000, :short => :p, :cli => 7000
116
+
117
+ o "Specify directory to serve static files",
118
+ :public_root, "public", :cli => "public"
119
+
120
+ o "Record all Request objects by assigning a filtering Proc to me.",
121
+ :record, false
122
+
123
+ o "root directory of your application (former APPDIR)",
124
+ :root, File.dirname(File.expand_path($0))
125
+
126
+ o "Don't wait until all adapter-threads are finished or killed.",
127
+ :run_loose, false, :cli => false
128
+
129
+ o "The runner of your application (start.rb)",
130
+ :runner, "/home/manveru/c/ramaze/examples/hello.rb"
131
+
132
+ o "The running server will be put here from Adapter.",
133
+ :server, nil
134
+
135
+ o "Turn on session for all requests.",
136
+ :sessions, true, :cli => true
137
+
138
+ o "Turn on BF/DoS protection for error-responses",
139
+ :shield, false, :cli => false
140
+
141
+ o "What signal to trap to call Ramaze::shutdown",
142
+ :shutdown_trap, "SIGINT"
143
+
144
+ o "Interval in seconds of the background SourceReload",
145
+ :sourcereload, 3, :cli => 3
146
+
147
+ o "Test before start if adapters will be able to connect",
148
+ :test_connections, true, :cli => true
149
+
150
+ o "Specify directory to serve dynamic files",
151
+ :view_root, "view", :cli => "view"
152
+ end
153
+ end