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
@@ -0,0 +1,23 @@
1
+ module Ramaze::Helper
2
+ module XHTML
3
+ def css(name, media = 'screen', options = {})
4
+ if options.empty?
5
+ "<link rel='stylesheet' href='/css/#{name}.css' type='text/css' media='#{media}' />"
6
+ elsif options[:only] == 'IE'
7
+ "<!--[if IE]>#{css(name, media)}<![endif]-->"
8
+ end
9
+ end
10
+
11
+ def css_for(*names)
12
+ names.flatten.map{|name| css(name) }.join("\n")
13
+ end
14
+
15
+ def js(name)
16
+ "<script src='/js/#{name}.js' type='text/javascript'></script>"
17
+ end
18
+
19
+ def js_for(*names)
20
+ names.flatten.map{|name| js(name) }.join("\n")
21
+ end
22
+ end
23
+ end
@@ -20,9 +20,8 @@ module Ramaze
20
20
  autoload :Growl, "ramaze/log/growl.rb"
21
21
  autoload :Xosd, "ramaze/log/xosd.rb"
22
22
  autoload :Logger, "ramaze/log/logger.rb"
23
- autoload :Inform, "ramaze/inform"
24
23
 
25
24
  unless defined?(Log)
26
- Log = LogHub.new(Informer)
25
+ Log = Logging::LogHub.new(Logging::Logger::Informer)
27
26
  end
28
27
  end
@@ -4,34 +4,39 @@
4
4
  require 'swiftcore/Analogger/Client'
5
5
 
6
6
  module Ramaze
7
+ module Logging
8
+ module Logger
7
9
 
8
- # Informer for the Swiftcore Analogger logging system.
9
- #
10
- # You can find it at http://analogger.swiftcore.org and install with
11
- # gem install analogger
10
+ # Informer for the Swiftcore Analogger logging system.
11
+ #
12
+ # You can find it at http://analogger.swiftcore.org and install with
13
+ # gem install analogger
12
14
 
13
- class Analogger < ::Swiftcore::Analogger::Client
14
- include Logging
15
+ class Analogger < ::Swiftcore::Analogger::Client
16
+ include Logging
15
17
 
16
- # identifier for your application
17
- trait :name => 'walrus'
18
+ # identifier for your application
19
+ trait :name => 'walrus'
18
20
 
19
- # Host analogger runs on
20
- trait :host => '127.0.0.1'
21
+ # Host analogger runs on
22
+ trait :host => '127.0.0.1'
21
23
 
22
- # Port analogger runs on
23
- trait :port => 6766
24
+ # Port analogger runs on
25
+ trait :port => 6766
24
26
 
25
- # Create a new instance, parameters default to the traits.
27
+ # Create a new instance, parameters default to the traits.
26
28
 
27
- def initialize(name = class_trait[:name], host = class_trait[:host], port = class_trait[:port])
28
- super
29
- end
29
+ def initialize(name = class_trait[:name], host = class_trait[:host], port = class_trait[:port])
30
+ super
31
+ end
32
+
33
+ # integration to Logging
30
34
 
31
- # integration to Logging
35
+ def log(tag, *args)
36
+ log(tag, args.join("\n"))
37
+ end
38
+ end
32
39
 
33
- def log(tag, *args)
34
- log(tag, args.join("\n"))
35
40
  end
36
41
  end
37
42
  end
@@ -4,32 +4,37 @@
4
4
  require 'ruby-growl'
5
5
 
6
6
  module Ramaze
7
+ module Logging
8
+ module Logger
7
9
 
8
- # Informer for the growl notification system on OSX.
10
+ # Informer for the growl notification system on OSX.
9
11
 
10
- class Growl < ::Growl
12
+ class Growl < ::Growl
11
13
 
12
- trait :defaults => {
13
- :name => 'walrus',
14
- :host => 'localhost',
15
- :password => 'walrus',
16
- :all_notifies => %w[error warn debug info dev],
17
- :default_notifies => %w[error warn info]
18
- }
14
+ trait :defaults => {
15
+ :name => 'walrus',
16
+ :host => 'localhost',
17
+ :password => 'walrus',
18
+ :all_notifies => %w[error warn debug info dev],
19
+ :default_notifies => %w[error warn info]
20
+ }
19
21
 
20
- # Takes the options from the default trait for merging.
22
+ # Takes the options from the default trait for merging.
21
23
 
22
- def initialize(options = {})
23
- options = class_trait[:defaults].merge(options).values_at(:host, :name, :all_notifies, :default_notifies, :password)
24
- super(*options)
25
- end
24
+ def initialize(options = {})
25
+ options = class_trait[:defaults].merge(options).values_at(:host, :name, :all_notifies, :default_notifies, :password)
26
+ super(*options)
27
+ end
28
+
29
+ # integration to Logging
26
30
 
27
- # integration to Logging
31
+ def log(tag, *args)
32
+ notify(tag.to_s, Time.now.strftime("%X"), args.join("\n")[0..100])
33
+ rescue Errno::EMSGSIZE
34
+ # Send size was to big (not really), ignore
35
+ end
36
+ end
28
37
 
29
- def log(tag, *args)
30
- notify(tag.to_s, Time.now.strftime("%X"), args.join("\n")[0..100])
31
- rescue Errno::EMSGSIZE
32
- # Send size was to big (not really), ignore
33
38
  end
34
39
  end
35
40
  end
@@ -2,37 +2,40 @@
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
4
  module Ramaze
5
+ module Logging
5
6
 
6
- # Bundles different informer instances and sends incoming messages to each.
7
- # This is the default with Informer as only member.
7
+ # Bundles different informer instances and sends incoming messages to each.
8
+ # This is the default with Informer as only member.
8
9
 
9
- class LogHub
10
- include Logging
10
+ class LogHub
11
+ include Logging
11
12
 
12
- attr_accessor :loggers
13
- attr_accessor :ignored_tags
13
+ attr_accessor :loggers
14
+ attr_accessor :ignored_tags
14
15
 
15
- # Takes a list of instances or classes (which will be initialized) and that
16
- # are added to @loggers. All messages are then sent to each member.
16
+ # Takes a list of instances or classes (which will be initialized) and that
17
+ # are added to @loggers. All messages are then sent to each member.
17
18
 
18
- def initialize(*loggers)
19
- @loggers = loggers
20
- @ignored_tags = Set.new
21
- @loggers.map! do |logger|
22
- next(nil) if logger == self
23
- logger.is_a?(Class) ? logger.new : logger
19
+ def initialize(*loggers)
20
+ @loggers = loggers
21
+ @ignored_tags = Set.new
22
+ @loggers.map! do |logger|
23
+ next(nil) if logger == self
24
+ logger.is_a?(Class) ? logger.new : logger
25
+ end
26
+ @loggers.uniq!
27
+ @loggers.compact!
24
28
  end
25
- @loggers.uniq!
26
- @loggers.compact!
27
- end
28
29
 
29
- # integration to Logging
30
+ # integration to Logging
30
31
 
31
- def log(tag, *args)
32
- return if @ignored_tags.include?(tag)
33
- @loggers.each do |logger|
34
- logger.log(tag, *args)
32
+ def log(tag, *args)
33
+ return if @ignored_tags.include?(tag)
34
+ @loggers.each do |logger|
35
+ logger.log(tag, *args)
36
+ end
35
37
  end
36
38
  end
39
+
37
40
  end
38
41
  end
@@ -2,124 +2,129 @@
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
4
  module Ramaze
5
-
6
- # A minimal logger for Ramaze, supports files, CLI, colors and some
7
- # customization.
8
-
9
- class Informer
10
- include Logging
11
-
12
- attr_accessor :out, :colorize, :log_levels
13
-
14
- # Should Ramaze try to use colors?
15
- trait :colorize => true
16
-
17
- # parameter for Time.now.strftime
18
- trait :timestamp => "%Y-%m-%d %H:%M:%S"
19
-
20
- # This is how the final output is arranged.
21
- trait :format => "[%time] %prefix %text"
22
-
23
- # Which tag should be in what color
24
- COLORS = {
25
- :dev => :blue,
26
- :debug => :yellow,
27
- :info => :green,
28
- :warn => :red,
29
- :error => :red,
30
- }
31
-
32
- # Create a new instance of Informer.
33
- # You can spcify
34
- #
35
- # Examples:
36
- # Informer.new #=> logs to stdout with all levels being
37
- # shown.
38
- # Informer.new($stderr) #=> same, but to stderr
39
- # Informer.new("foo.log") #=> same, but logs to the file foo.log
40
- # (or creates it if it doesn't exist yet)
41
- # Informer.new($stdout, [:info]) #=> show only #info messages to stdout.
42
-
43
- def initialize(out = $stdout, log_levels = [:debug, :error, :info, :warn])
44
- @colorize = false
45
-
46
- @out =
47
- case out
48
- when STDOUT, :stdout, 'stdout'
49
- $stdout
50
- when STDERR, :stderr, 'stderr'
51
- $stderr
52
- when IO
53
- out
54
- else
55
- if out.respond_to?(:puts)
56
- out
57
- else
58
- File.open(out.to_s, 'ab+')
5
+ module Logging
6
+ module Logger
7
+
8
+ # A minimal logger for Ramaze, supports files, CLI, colors and some
9
+ # customization.
10
+
11
+ class Informer
12
+ include Logging
13
+
14
+ attr_accessor :out, :colorize, :log_levels
15
+
16
+ # Should Ramaze try to use colors?
17
+ trait :colorize => true
18
+
19
+ # parameter for Time.now.strftime
20
+ trait :timestamp => "%Y-%m-%d %H:%M:%S"
21
+
22
+ # This is how the final output is arranged.
23
+ trait :format => "[%time] %prefix %text"
24
+
25
+ # Which tag should be in what color
26
+ COLORS = {
27
+ :dev => :blue,
28
+ :debug => :yellow,
29
+ :info => :green,
30
+ :warn => :red,
31
+ :error => :red,
32
+ }
33
+
34
+ # Create a new instance of Informer.
35
+ # You can spcify
36
+ #
37
+ # Examples:
38
+ # Informer.new #=> logs to stdout with all levels being
39
+ # shown.
40
+ # Informer.new($stderr) #=> same, but to stderr
41
+ # Informer.new("foo.log") #=> same, but logs to the file foo.log
42
+ # (or creates it if it doesn't exist yet)
43
+ # Informer.new($stdout, [:info]) #=> show only #info messages to stdout.
44
+
45
+ def initialize(out = $stdout, log_levels = [:debug, :error, :info, :warn])
46
+ @colorize = false
47
+
48
+ @out =
49
+ case out
50
+ when STDOUT, :stdout, 'stdout'
51
+ $stdout
52
+ when STDERR, :stderr, 'stderr'
53
+ $stderr
54
+ when IO
55
+ out
56
+ else
57
+ if out.respond_to?(:puts)
58
+ out
59
+ else
60
+ File.open(out.to_s, 'ab+')
61
+ end
62
+ end
63
+
64
+ if @out.respond_to?(:tty?) and class_trait[:colorize]
65
+ @colorize = @out.tty?
59
66
  end
60
- end
61
67
 
62
- if @out.respond_to?(:tty?) and class_trait[:colorize]
63
- @colorize = @out.tty?
64
- end
68
+ @log_levels = log_levels
69
+ end
65
70
 
66
- @log_levels = log_levels
67
- end
71
+ # Close the file we log to if it isn't closed already.
68
72
 
69
- # Close the file we log to if it isn't closed already.
73
+ def shutdown
74
+ if @out.respond_to?(:close)
75
+ Log.debug("close, #{@out.inspect}")
76
+ @out.close
77
+ end
78
+ end
70
79
 
71
- def shutdown
72
- if @out.respond_to?(:close)
73
- Log.debug("close, #{@out.inspect}")
74
- @out.close
75
- end
76
- end
80
+ # Integration to Logging.
77
81
 
78
- # Integration to Logging.
82
+ def log tag, *messages
83
+ return if closed? || !@log_levels.include?(tag)
84
+ messages.flatten!
79
85
 
80
- def log tag, *messages
81
- return if closed? || !@log_levels.include?(tag)
82
- messages.flatten!
86
+ prefix = tag.to_s.upcase.ljust(5)
83
87
 
84
- prefix = tag.to_s.upcase.ljust(5)
88
+ if @colorize
89
+ color = COLORS[tag] ||= :white
90
+ prefix.replace prefix.send(color)
91
+ end
85
92
 
86
- if @colorize
87
- color = COLORS[tag] ||= :white
88
- prefix.replace prefix.send(color)
89
- end
93
+ messages.each do |message|
94
+ @out.puts(log_interpolate(prefix, message))
95
+ end
90
96
 
91
- messages.each do |message|
92
- @out.puts(log_interpolate(prefix, message))
93
- end
97
+ @out.flush if @out.respond_to?(:flush)
98
+ end
94
99
 
95
- @out.flush if @out.respond_to?(:flush)
96
- end
100
+ # Takes the prefix (tag), text and timestamp and applies it to
101
+ # the :format trait.
97
102
 
98
- # Takes the prefix (tag), text and timestamp and applies it to
99
- # the :format trait.
103
+ def log_interpolate prefix, text, time = timestamp
104
+ message = class_trait[:format].dup
100
105
 
101
- def log_interpolate prefix, text, time = timestamp
102
- message = class_trait[:format].dup
106
+ vars = { '%time' => time, '%prefix' => prefix, '%text' => text }
107
+ vars.each{|from, to| message.gsub!(from, to) }
103
108
 
104
- vars = { '%time' => time, '%prefix' => prefix, '%text' => text }
105
- vars.each{|from, to| message.gsub!(from, to) }
109
+ message
110
+ end
106
111
 
107
- message
108
- end
112
+ # This uses Global.inform_timestamp or a date in the format of
113
+ # %Y-%m-%d %H:%M:%S
114
+ # # => "2007-01-19 21:09:32"
109
115
 
110
- # This uses Global.inform_timestamp or a date in the format of
111
- # %Y-%m-%d %H:%M:%S
112
- # # => "2007-01-19 21:09:32"
116
+ def timestamp
117
+ mask = class_trait[:timestamp]
118
+ Time.now.strftime(mask || "%Y-%m-%d %H:%M:%S")
119
+ end
113
120
 
114
- def timestamp
115
- mask = class_trait[:timestamp]
116
- Time.now.strftime(mask || "%Y-%m-%d %H:%M:%S")
117
- end
121
+ # is @out closed?
118
122
 
119
- # is @out closed?
123
+ def closed?
124
+ @out.respond_to?(:closed?) and @out.closed?
125
+ end
126
+ end
120
127
 
121
- def closed?
122
- @out.respond_to?(:closed?) and @out.closed?
123
128
  end
124
129
  end
125
130
  end
@@ -2,24 +2,29 @@
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
4
  module Ramaze
5
+ module Logging
6
+ module Logger
5
7
 
6
- # Informer for the Knotify notfication system used on KDE.
7
- # Doesn't need any special libraries.
8
+ # Informer for the Knotify notfication system used on KDE.
9
+ # Doesn't need any special libraries.
8
10
 
9
- class Knotify
10
- include Logging
11
+ class Knotify
12
+ include Logging
11
13
 
12
- trait :present => 16
14
+ trait :present => 16
13
15
 
14
- # Please see for more information on the API used here:
15
- # http://lukeplant.me.uk/articles.php?id=3
16
+ # Please see for more information on the API used here:
17
+ # http://lukeplant.me.uk/articles.php?id=3
16
18
 
17
- def log(tag, *messages)
18
- present = class_trait[:present]
19
- tag = tag.to_s.capitalize
20
- messages.flatten.each do |message|
21
- system(%{dcop knotify default notify Ramaze "#{tag}" "#{message}" '' '' #{present} 0})
19
+ def log(tag, *messages)
20
+ present = class_trait[:present]
21
+ tag = tag.to_s.capitalize
22
+ messages.flatten.each do |message|
23
+ system(%{dcop knotify default notify Ramaze "#{tag}" "#{message}" '' '' #{present} 0})
24
+ end
25
+ end
22
26
  end
27
+
23
28
  end
24
29
  end
25
30
  end