ramaze 0.3.9.1 → 2008.06
Sign up to get free protection for your applications and to get access to all the features.
- data/{doc/README → README.markdown} +78 -32
- data/Rakefile +53 -50
- data/benchmark/results.txt +131 -0
- data/benchmark/run.rb +362 -0
- data/benchmark/suite/minimal.rb +13 -0
- data/benchmark/suite/no_informer.rb +9 -0
- data/benchmark/suite/no_sessions.rb +10 -0
- data/benchmark/suite/no_template.rb +9 -0
- data/benchmark/suite/simple.rb +7 -0
- data/benchmark/suite/template_amrita2.rb +17 -0
- data/benchmark/suite/template_builder.rb +12 -0
- data/benchmark/suite/template_erubis.rb +10 -0
- data/benchmark/suite/template_ezamar.rb +10 -0
- data/benchmark/suite/template_haml.rb +15 -0
- data/benchmark/suite/template_liquid.rb +13 -0
- data/benchmark/suite/template_markaby.rb +11 -0
- data/benchmark/suite/template_nagoro.rb +10 -0
- data/benchmark/suite/template_redcloth.rb +15 -0
- data/benchmark/suite/template_tenjin.rb +10 -0
- data/benchmark/test.rb +35 -0
- data/bin/ramaze +32 -122
- data/cache.yaml +7 -0
- data/doc/AUTHORS +26 -22
- data/doc/CHANGELOG +16720 -3907
- data/doc/INSTALL +77 -19
- data/doc/LEGAL +0 -4
- data/doc/meta/announcement.txt +43 -54
- data/doc/meta/configuration.txt +3 -2
- data/doc/readme_chunks/examples.txt +2 -2
- data/doc/readme_chunks/installing.txt +66 -20
- data/doc/tutorial/todolist.html +338 -520
- data/doc/tutorial/todolist.mkd +36 -2
- data/examples/{auth → app/auth}/auth.rb +0 -0
- data/examples/{auth → app/auth}/template/layout.haml +0 -0
- data/examples/{auth → app/auth}/template/login.haml +0 -0
- data/examples/{blog → app/blog}/README +0 -0
- data/examples/{blog → app/blog}/controller/main.rb +1 -1
- data/examples/{blog → app/blog}/model/entry.rb +1 -1
- data/examples/{blog → app/blog}/public/styles/blog.css +0 -0
- data/examples/{blog → app/blog}/spec/blog.rb +2 -2
- data/examples/{blog → app/blog}/start.rb +0 -0
- data/examples/{blog → app/blog}/view/edit.xhtml +0 -0
- data/examples/{blog → app/blog}/view/index.xhtml +0 -0
- data/examples/{blog → app/blog}/view/layout.xhtml +0 -0
- data/examples/{blog → app/blog}/view/new.xhtml +0 -0
- data/examples/app/chat/model/history.rb +36 -0
- data/examples/app/chat/model/message.rb +7 -0
- data/examples/app/chat/public/css/chat.css +13 -0
- data/examples/app/chat/public/js/chat.js +22 -0
- data/examples/app/chat/public/js/jquery.js +3436 -0
- data/examples/app/chat/start.rb +40 -0
- data/examples/app/chat/view/chat.xhtml +9 -0
- data/examples/app/chat/view/index.xhtml +7 -0
- data/examples/app/chat/view/layout.xhtml +13 -0
- data/examples/app/localization/start.rb +35 -0
- data/examples/{rammit → app/rammit}/spec/rammit.rb +2 -1
- data/examples/{rammit → app/rammit}/src/controller/main.rb +0 -0
- data/examples/{rammit → app/rammit}/src/controller/page.rb +0 -0
- data/examples/{rammit → app/rammit}/src/model.rb +0 -0
- data/examples/{rammit → app/rammit}/start.rb +0 -0
- data/examples/{rammit → app/rammit}/template/index.xhtml +0 -0
- data/examples/{rammit → app/rammit}/template/page/view.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/Rakefile +0 -1
- data/examples/{rapaste → app/rapaste}/controller/paste.rb +3 -3
- data/examples/{rapaste → app/rapaste}/model/paste.rb +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/active4d.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/all_hallows_eve.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/amy.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/blackboard.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/brilliance_black.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/brilliance_dull.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/cobalt.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/dawn.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/display.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/eiffel.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/espresso_libre.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/idle.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/iplastic.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/lazy.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/mac_classic.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/magicwb_amiga.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/pastels_on_dark.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/slush_poppies.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/spacecadet.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/sunburst.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/twilight.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/zenburnesque.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/js/jquery.js +0 -0
- data/examples/{rapaste → app/rapaste}/spec/rapaste.rb +2 -2
- data/examples/{rapaste → app/rapaste}/start.rb +0 -0
- data/examples/{rapaste → app/rapaste}/view/copy.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/index.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/layout.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/list.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/search.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/view.xhtml +0 -0
- data/examples/{sourceview → app/sourceview}/public/coderay.css +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/file.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/folder.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-collapsable-last.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-collapsable.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-expandable-last.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-expandable.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-item-last.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-item.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/jquery.js +0 -0
- data/examples/{sourceview → app/sourceview}/public/jquery.treeview.css +0 -0
- data/examples/{sourceview → app/sourceview}/public/jquery.treeview.js +0 -0
- data/examples/{sourceview → app/sourceview}/public/sourceview.js +0 -0
- data/examples/{sourceview → app/sourceview}/sourceview.rb +1 -1
- data/examples/{sourceview → app/sourceview}/template/index.haml +0 -0
- data/examples/{todolist → app/todolist}/README +0 -0
- data/examples/{todolist → app/todolist}/public/favicon.ico +0 -0
- data/examples/{todolist → app/todolist}/public/js/jquery.js +0 -0
- data/examples/{todolist → app/todolist}/public/ramaze.png +0 -0
- data/examples/{todolist → app/todolist}/spec/todolist.rb +2 -2
- data/examples/{todolist → app/todolist}/src/controller/main.rb +0 -0
- data/examples/{todolist → app/todolist}/src/element/page.rb +0 -0
- data/examples/{todolist → app/todolist}/src/model.rb +0 -0
- data/examples/{todolist → app/todolist}/start.rb +0 -0
- data/examples/{todolist → app/todolist}/template/index.xhtml +0 -0
- data/examples/{todolist → app/todolist}/template/new.xhtml +0 -0
- data/examples/{upload → app/upload}/start.rb +0 -0
- data/examples/{upload → app/upload}/view/index.xhtml +0 -0
- data/examples/{whywiki → app/whywiki}/spec/whywiki.rb +3 -3
- data/examples/{whywiki → app/whywiki}/start.rb +0 -0
- data/examples/{whywiki → app/whywiki}/template/edit.xhtml +0 -0
- data/examples/{whywiki → app/whywiki}/template/show.xhtml +0 -0
- data/examples/{wikore → app/wikore}/spec/wikore.rb +2 -2
- data/examples/{wikore → app/wikore}/src/controller.rb +0 -0
- data/examples/{wikore → app/wikore}/src/model.rb +0 -0
- data/examples/{wikore → app/wikore}/start.rb +0 -0
- data/examples/{wikore → app/wikore}/template/index.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/README +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/link/2007-07-20_19-45-51.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/link/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_16-31-33.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-21-12.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-23-10.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-45-07.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/markdown/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-20_16-43-46.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-20_19-43-50.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-46-01.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-46-32.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-47-08.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-47-54.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/public/favicon.ico +0 -0
- data/examples/{wiktacular → app/wiktacular}/public/screen.css +0 -0
- data/examples/{wiktacular → app/wiktacular}/spec/wiktacular.rb +4 -5
- data/examples/{wiktacular → app/wiktacular}/src/controller.rb +0 -0
- data/examples/{wiktacular → app/wiktacular}/src/model.rb +0 -0
- data/examples/{wiktacular → app/wiktacular}/start.rb +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/edit.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/html_layout.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/index.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/new.xhtml +0 -0
- data/examples/{element.rb → basic/element.rb} +0 -0
- data/examples/basic/gestalt.rb +27 -0
- data/examples/{hello.rb → basic/hello.rb} +0 -0
- data/examples/{layout.rb → basic/layout.rb} +0 -0
- data/examples/{linking.rb → basic/linking.rb} +0 -0
- data/examples/{simple.rb → basic/simple.rb} +3 -3
- data/examples/{caching.rb → helpers/cache.rb} +0 -0
- data/examples/helpers/form_with_sequel.rb +24 -0
- data/examples/helpers/httpdigest.rb +50 -0
- data/examples/{identity.rb → helpers/identity.rb} +0 -0
- data/examples/{nitro_form.rb → helpers/nitro_form.rb} +0 -0
- data/examples/helpers/provide.rb +23 -0
- data/examples/helpers/rest.rb +28 -0
- data/examples/helpers/simple_captcha.rb +29 -0
- data/examples/{css.rb → misc/css.rb} +0 -0
- data/examples/{facebook.rb → misc/facebook.rb} +0 -0
- data/examples/{memleak_detector.rb → misc/memleak_detector.rb} +0 -0
- data/examples/misc/nagoro_element.rb +43 -0
- data/examples/{ramaise.rb → misc/ramaise.rb} +0 -0
- data/examples/misc/rapp.rb +45 -0
- data/examples/misc/sequel_scaffolding.rb +34 -0
- data/examples/{simple_auth.rb → misc/simple_auth.rb} +0 -0
- data/examples/templates/template_amrita2.rb +1 -1
- data/examples/templates/template_erubis.rb +2 -2
- data/examples/templates/template_ezamar.rb +1 -1
- data/examples/templates/template_haml.rb +2 -2
- data/examples/templates/template_liquid.rb +2 -2
- data/examples/templates/template_markaby.rb +1 -1
- data/examples/templates/template_nagoro.rb +1 -1
- data/examples/templates/template_redcloth.rb +2 -2
- data/examples/templates/template_remarkably.rb +1 -1
- data/examples/templates/template_tenjin.rb +5 -9
- data/examples/templates/template_xslt.rb +1 -1
- data/lib/proto/public/dispatch.fcgi +0 -0
- data/lib/proto/public/js/jquery.js +750 -577
- data/lib/proto/spec/main.rb +1 -1
- data/lib/proto/start.ru +8 -0
- data/lib/proto/view/page.xhtml +13 -1
- data/lib/ramaze.rb +32 -15
- data/lib/ramaze/action.rb +18 -1
- data/lib/ramaze/action/render.rb +45 -17
- data/lib/ramaze/adapter.rb +8 -7
- data/lib/ramaze/adapter/base.rb +79 -13
- data/lib/ramaze/adapter/cgi.rb +5 -10
- data/lib/ramaze/adapter/ebb.rb +6 -20
- data/lib/ramaze/adapter/fake.rb +12 -0
- data/lib/ramaze/adapter/fcgi.rb +5 -11
- data/lib/ramaze/adapter/lsws.rb +5 -9
- data/lib/ramaze/adapter/mongrel.rb +5 -9
- data/lib/ramaze/adapter/scgi.rb +4 -8
- data/lib/ramaze/adapter/thin.rb +6 -11
- data/lib/ramaze/adapter/webrick.rb +13 -22
- data/lib/ramaze/cache.rb +36 -10
- data/lib/ramaze/cache/memcached.rb +3 -2
- data/lib/ramaze/contrib.rb +1 -1
- data/lib/ramaze/contrib/email.rb +1 -1
- data/lib/ramaze/contrib/file_cache.rb +1 -1
- data/lib/ramaze/contrib/gems.rb +79 -0
- data/lib/ramaze/contrib/gettext/po.rb +0 -0
- data/lib/ramaze/contrib/profiling.rb +1 -1
- data/lib/ramaze/contrib/rest.rb +14 -0
- data/lib/ramaze/controller.rb +45 -12
- data/lib/ramaze/controller/error.rb +4 -4
- data/lib/ramaze/controller/resolve.rb +61 -42
- data/lib/ramaze/current.rb +2 -2
- data/lib/ramaze/current/request.rb +25 -2
- data/lib/ramaze/current/response.rb +8 -0
- data/lib/ramaze/current/session.rb +64 -36
- data/lib/ramaze/current/session/flash.rb +14 -2
- data/lib/ramaze/current/session/hash.rb +3 -2
- data/lib/ramaze/dispatcher.rb +25 -12
- data/lib/ramaze/dispatcher/action.rb +12 -3
- data/lib/ramaze/dispatcher/directory.rb +4 -1
- data/lib/ramaze/dispatcher/error.rb +3 -3
- data/lib/ramaze/dispatcher/file.rb +11 -3
- data/lib/ramaze/gestalt.rb +1 -1
- data/lib/ramaze/helper.rb +17 -21
- data/lib/ramaze/helper/aspect.rb +20 -14
- data/lib/ramaze/helper/auth.rb +1 -1
- data/lib/ramaze/helper/cache.rb +3 -6
- data/lib/ramaze/helper/cgi.rb +6 -2
- data/lib/ramaze/helper/flash.rb +7 -7
- data/lib/ramaze/helper/form.rb +281 -0
- data/lib/ramaze/helper/formatting.rb +76 -0
- data/lib/ramaze/helper/gestalt.rb +15 -0
- data/lib/ramaze/helper/gravatar.rb +15 -0
- data/lib/ramaze/helper/httpdigest.rb +48 -0
- data/lib/ramaze/helper/identity.rb +87 -62
- data/lib/ramaze/helper/partial.rb +11 -2
- data/lib/ramaze/helper/redirect.rb +12 -3
- data/lib/ramaze/helper/rest.rb +43 -0
- data/lib/ramaze/helper/sendfile.rb +1 -3
- data/lib/ramaze/helper/sequel.rb +3 -0
- data/lib/ramaze/helper/simple_captcha.rb +31 -0
- data/lib/ramaze/helper/stack.rb +14 -5
- data/lib/ramaze/helper/user.rb +86 -34
- data/lib/ramaze/helper/xhtml.rb +23 -0
- data/lib/ramaze/log.rb +1 -2
- data/lib/ramaze/log/analogger.rb +24 -19
- data/lib/ramaze/log/growl.rb +24 -19
- data/lib/ramaze/log/hub.rb +25 -22
- data/lib/ramaze/log/informer.rb +104 -99
- data/lib/ramaze/log/knotify.rb +17 -12
- data/lib/ramaze/log/logger.rb +14 -8
- data/lib/ramaze/log/logging.rb +63 -60
- data/lib/ramaze/log/syslog.rb +24 -19
- data/lib/ramaze/log/xosd.rb +77 -71
- data/lib/ramaze/option.rb +153 -0
- data/lib/ramaze/option/dsl.rb +45 -0
- data/lib/ramaze/option/holder.rb +153 -0
- data/lib/ramaze/option/merger.rb +108 -0
- data/lib/ramaze/route.rb +15 -2
- data/lib/ramaze/setup.rb +50 -0
- data/lib/ramaze/snippets/binding/locals.rb +1 -1
- data/lib/ramaze/snippets/dictionary.rb +3 -3
- data/lib/ramaze/snippets/divide.rb +7 -7
- data/lib/ramaze/snippets/kernel/__dir__.rb +1 -1
- data/lib/ramaze/snippets/kernel/acquire.rb +0 -5
- data/lib/ramaze/snippets/metaid.rb +1 -1
- data/lib/ramaze/snippets/numeric/filesize_format.rb +11 -5
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +8 -0
- data/lib/ramaze/snippets/object/scope.rb +1 -1
- data/lib/ramaze/snippets/object/thread_accessor.rb +1 -1
- data/lib/ramaze/snippets/ordered_set.rb +5 -1
- data/lib/ramaze/snippets/ramaze/deprecated.rb +7 -0
- data/lib/ramaze/snippets/ramaze/thread_accessor.rb +15 -1
- data/lib/ramaze/snippets/string/esc.rb +2 -2
- data/lib/ramaze/snippets/string/start_with.rb +1 -0
- data/lib/ramaze/snippets/string/unindent.rb +9 -1
- data/lib/ramaze/snippets/struct/values_at.rb +17 -1
- data/lib/ramaze/snippets/thread/into.rb +1 -1
- data/lib/ramaze/sourcereload.rb +83 -76
- data/lib/ramaze/spec/helper.rb +39 -26
- data/lib/ramaze/spec/helper/bacon.rb +5 -5
- data/lib/ramaze/spec/helper/mock_http.rb +1 -7
- data/lib/ramaze/spec/helper/pretty_output.rb +10 -2
- data/lib/ramaze/spec/helper/requester.rb +14 -0
- data/lib/ramaze/template.rb +6 -3
- data/lib/ramaze/template/amrita2.rb +1 -0
- data/lib/ramaze/template/erubis.rb +7 -1
- data/lib/ramaze/template/ezamar/render_partial.rb +1 -1
- data/lib/ramaze/template/nagoro.rb +1 -0
- data/lib/ramaze/template/redcloth.rb +1 -0
- data/lib/ramaze/template/tagz.rb +8 -8
- data/lib/ramaze/template/tenjin.rb +42 -2
- data/lib/ramaze/template/xslt.rb +4 -0
- data/lib/ramaze/tool/daemonize.rb +37 -0
- data/lib/ramaze/tool/localize.rb +142 -106
- data/lib/ramaze/version.rb +2 -10
- data/rake_tasks/conf.rake +11 -13
- data/rake_tasks/gem.rake +59 -37
- data/rake_tasks/git.rake +41 -0
- data/rake_tasks/maintenance.rake +263 -299
- data/rake_tasks/release.rake +63 -0
- data/rake_tasks/spec.rake +1 -1
- data/ramaze.gemspec +731 -0
- data/spec/contrib/profiling.rb +5 -2
- data/spec/examples/caching.rb +1 -1
- data/spec/examples/css.rb +1 -1
- data/spec/examples/element.rb +1 -1
- data/spec/examples/hello.rb +1 -1
- data/spec/examples/linking.rb +1 -1
- data/spec/examples/simple.rb +1 -1
- data/spec/examples/simple_auth.rb +1 -1
- data/spec/ramaze/action/cache.rb +58 -14
- data/spec/ramaze/action/file_cache.rb +48 -0
- data/spec/ramaze/action/layout.rb +2 -2
- data/spec/ramaze/action/render.rb +1 -2
- data/spec/ramaze/action/{template → view}/bar.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/instancevars/layout.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/other_wrapper.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/single_wrapper.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/sub/sub_wrapper.xhtml +0 -0
- data/spec/ramaze/adapter.rb +29 -2
- data/spec/ramaze/adapter/ebb.rb +12 -0
- data/spec/ramaze/cache.rb +82 -15
- data/spec/ramaze/controller.rb +6 -3
- data/spec/ramaze/controller/actionless_templates.rb +2 -2
- data/spec/ramaze/controller/resolve.rb +1 -1
- data/spec/ramaze/controller/template_resolving.rb +4 -6
- data/spec/ramaze/controller/{template → view}/greet.xhtml +0 -0
- data/spec/ramaze/controller/{template → view}/list.xhtml +0 -0
- data/spec/ramaze/controller/{template → view}/other/greet/other.xhtml +0 -0
- data/spec/ramaze/controller/{template → view}/other_wrapper.xhtml +0 -0
- data/spec/ramaze/error.rb +1 -1
- data/spec/ramaze/helper/aspect.rb +4 -4
- data/spec/ramaze/helper/cache.rb +56 -39
- data/spec/ramaze/helper/flash.rb +14 -1
- data/spec/ramaze/helper/form.rb +118 -0
- data/spec/ramaze/helper/formatting.rb +21 -0
- data/spec/ramaze/helper/link.rb +2 -2
- data/spec/ramaze/helper/pager.rb +2 -2
- data/spec/ramaze/helper/partial.rb +13 -1
- data/spec/ramaze/helper/simple_captcha.rb +22 -0
- data/spec/ramaze/helper/user.rb +7 -10
- data/spec/ramaze/helper/{template → view}/locals.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/loop.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/num.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/partial.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/recursive.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/recursive_local_ivars.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/recursive_locals.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/test_template.xhtml +0 -0
- data/spec/ramaze/localize.rb +22 -0
- data/spec/ramaze/log/informer.rb +10 -10
- data/spec/ramaze/log/syslog.rb +1 -1
- data/spec/ramaze/request.rb +13 -1
- data/spec/ramaze/request/ebb.rb +9 -0
- data/spec/ramaze/rewrite.rb +36 -0
- data/spec/ramaze/rewrite/file.css +1 -0
- data/spec/ramaze/route.rb +1 -0
- data/spec/ramaze/template.rb +5 -5
- data/spec/ramaze/template/amrita2.rb +1 -1
- data/spec/ramaze/template/builder.rb +18 -22
- data/spec/ramaze/template/erubis.rb +1 -1
- data/spec/ramaze/template/ezamar.rb +1 -1
- data/spec/ramaze/template/haml.rb +2 -2
- data/spec/ramaze/template/liquid.rb +1 -1
- data/spec/ramaze/template/markaby.rb +1 -1
- data/spec/ramaze/template/nagoro.rb +1 -1
- data/spec/ramaze/template/redcloth.rb +1 -1
- data/spec/ramaze/template/remarkably.rb +1 -1
- data/spec/ramaze/template/sass.rb +1 -1
- data/spec/ramaze/template/tagz.rb +1 -1
- data/spec/ramaze/template/tenjin.rb +4 -6
- data/spec/ramaze/template/xslt.rb +1 -1
- data/spec/snippets/string/unindent.rb +6 -0
- data/spec/snippets/struct/values_at.rb +8 -0
- metadata +522 -487
- data/doc/ProjectInfo +0 -53
- data/doc/migrate/1110_to_1111.txt +0 -131
- data/lib/ramaze/contrib/route.rb +0 -22
- data/lib/ramaze/global.rb +0 -116
- data/lib/ramaze/global/dsl.rb +0 -39
- data/lib/ramaze/global/globalstruct.rb +0 -147
- data/lib/ramaze/helper/inform.rb +0 -40
- data/lib/ramaze/inform.rb +0 -4
- data/lib/ramaze/snippets/kernel/aquire.rb +0 -1
- data/lib/vendor/bacon.rb +0 -323
- data/rake_tasks/darcs.rake +0 -5
- data/spec/contrib/route.rb +0 -36
data/spec/contrib/profiling.rb
CHANGED
@@ -11,13 +11,16 @@ class MainController < Ramaze::Controller
|
|
11
11
|
end
|
12
12
|
|
13
13
|
output = StringIO.new
|
14
|
-
Ramaze::
|
14
|
+
Ramaze::Log.loggers << Ramaze::Logging::Logger::Informer.new(output)
|
15
15
|
|
16
16
|
describe 'Profiling' do
|
17
17
|
behaves_like "http"
|
18
|
-
ramaze
|
18
|
+
ramaze :public_root => __DIR__/:public
|
19
19
|
|
20
20
|
it "should profile" do
|
21
|
+
output = StringIO.new
|
22
|
+
Ramaze::Log.loggers << Ramaze::Logging::Logger::Informer.new(output)
|
23
|
+
|
21
24
|
get('/')
|
22
25
|
output.string.should =~ /Thread ID:\s\d+/
|
23
26
|
output.string.should =~ /Total:/
|
data/spec/examples/caching.rb
CHANGED
data/spec/examples/css.rb
CHANGED
data/spec/examples/element.rb
CHANGED
data/spec/examples/hello.rb
CHANGED
data/spec/examples/linking.rb
CHANGED
data/spec/examples/simple.rb
CHANGED
data/spec/ramaze/action/cache.rb
CHANGED
@@ -14,30 +14,74 @@ class TCOtherCache < Ramaze::Controller
|
|
14
14
|
map '/other'
|
15
15
|
helper :cache
|
16
16
|
|
17
|
-
def
|
17
|
+
def foo
|
18
18
|
rand
|
19
19
|
end
|
20
|
-
cache :
|
20
|
+
cache :foo
|
21
|
+
|
22
|
+
def query
|
23
|
+
@foo = request['foo']
|
24
|
+
'#{rand} #{@foo}'
|
25
|
+
end
|
26
|
+
cache :query, :key => lambda{ request['foo'] }
|
27
|
+
|
28
|
+
def set_flash
|
29
|
+
flash[:message] = "This is a random flash message: #{rand}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def use_flash
|
33
|
+
'#{rand} - Flash message: #{flash[:message]}'
|
34
|
+
end
|
35
|
+
cache :use_flash
|
21
36
|
end
|
22
37
|
|
23
38
|
describe 'Action rendering' do
|
24
|
-
behaves_like 'http'
|
39
|
+
behaves_like 'http', 'browser'
|
40
|
+
ramaze :adapter => :webrick
|
25
41
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
def req(path) r = get(path); [r.content_type, r.body] end
|
42
|
+
def req(path)
|
43
|
+
r = get(path)
|
44
|
+
[ r.content_type, r.body ]
|
45
|
+
end
|
31
46
|
|
32
|
-
|
47
|
+
should 'cache /' do
|
33
48
|
lambda{ req('/') }.should.not.change{ req('/') }
|
34
|
-
File.file?(@public_root/'index').should == true
|
35
49
|
end
|
36
50
|
|
37
|
-
|
38
|
-
lambda{ req('/other') }.should.not.change{ req('/other') }
|
39
|
-
|
51
|
+
should 'cache /other/foo' do
|
52
|
+
lambda{ req('/other/foo') }.should.not.change{ req('/other/foo') }
|
53
|
+
end
|
54
|
+
|
55
|
+
should 'respect custom cache key' do
|
56
|
+
get('/other/query', {:foo => 1}).body.should == get('/other/query', {:foo => 1}).body
|
57
|
+
get('/other/query', {:foo => 1}).body.should.not == get('/other/query', {:foo => 2}).body
|
58
|
+
end
|
59
|
+
|
60
|
+
should 'not cache when flash data exists and no_cache_flash is on' do
|
61
|
+
Ramaze::Global.no_cache_flash = true
|
62
|
+
b = Browser.new
|
63
|
+
|
64
|
+
# If there's no flash data, caching should operate.
|
65
|
+
b.get('/other/use_flash').should == b.get('/other/use_flash')
|
66
|
+
|
67
|
+
# When flash data exists, should ignore cache and generate fresh response.
|
68
|
+
prev = b.get('/other/use_flash')
|
69
|
+
b.get('/other/set_flash')
|
70
|
+
b.get('/other/use_flash').should.not == prev
|
71
|
+
# On next request, flash data should be gone, so get cached response.
|
72
|
+
b.get('/other/use_flash').should == prev
|
73
|
+
end
|
74
|
+
|
75
|
+
should 'always cache if no_cache_flash is off' do
|
76
|
+
Ramaze::Global.no_cache_flash = false
|
77
|
+
b = Browser.new
|
78
|
+
|
79
|
+
b.get('/other/use_flash').should == b.get('/other/use_flash')
|
80
|
+
|
81
|
+
# When flash data exists, should still cache.
|
82
|
+
prev = b.get('/other/use_flash')
|
83
|
+
b.get('/other/set_flash')
|
84
|
+
b.get('/other/use_flash').should == prev
|
40
85
|
end
|
41
86
|
|
42
|
-
FileUtils.rm_rf @public_root
|
43
87
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec/helper'
|
2
|
+
|
3
|
+
# Tests the file_cache facility that saves rendered content to files in
|
4
|
+
# /public and hence serves up the static files for subsequent requests.
|
5
|
+
class TCActionCache < Ramaze::Controller
|
6
|
+
map '/'
|
7
|
+
helper :cache
|
8
|
+
|
9
|
+
def index
|
10
|
+
rand
|
11
|
+
end
|
12
|
+
cache :index
|
13
|
+
end
|
14
|
+
|
15
|
+
class TCOtherCache < Ramaze::Controller
|
16
|
+
map '/other'
|
17
|
+
helper :cache
|
18
|
+
|
19
|
+
def index
|
20
|
+
rand
|
21
|
+
end
|
22
|
+
cache :index
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'Action rendering' do
|
26
|
+
behaves_like 'http'
|
27
|
+
|
28
|
+
FileUtils.mkdir_p(public_root = __DIR__/:public)
|
29
|
+
|
30
|
+
ramaze :file_cache => true, :public_root => public_root
|
31
|
+
|
32
|
+
def req(path)
|
33
|
+
r = get(path)
|
34
|
+
[ r.content_type, r.body ]
|
35
|
+
end
|
36
|
+
|
37
|
+
should 'cache to file' do
|
38
|
+
lambda{ req('/') }.should.not.change{ req('/') }
|
39
|
+
File.file?(public_root/'index').should == true
|
40
|
+
end
|
41
|
+
|
42
|
+
should 'create subdirs as needed' do
|
43
|
+
lambda{ req('/other') }.should.not.change{ req('/other') }
|
44
|
+
File.file?(public_root/'other/index').should == true
|
45
|
+
end
|
46
|
+
|
47
|
+
FileUtils.rm_rf public_root
|
48
|
+
end
|
@@ -20,7 +20,7 @@ end
|
|
20
20
|
class TCActionOtherLayout < Ramaze::Controller
|
21
21
|
map '/other'
|
22
22
|
layout '/other_wrapper'
|
23
|
-
|
23
|
+
view_root __DIR__/:view
|
24
24
|
|
25
25
|
def index
|
26
26
|
"Others Hello"
|
@@ -140,7 +140,7 @@ end
|
|
140
140
|
|
141
141
|
describe 'Action rendering' do
|
142
142
|
behaves_like 'http'
|
143
|
-
ramaze
|
143
|
+
ramaze :view_root => __DIR__/:view
|
144
144
|
|
145
145
|
it 'should work with layouts' do
|
146
146
|
get('/').body.should == "<pre>Hello, World!</pre>"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/ramaze/adapter.rb
CHANGED
@@ -11,12 +11,39 @@ class TCAdapterController < Ramaze::Controller
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
$output = StringIO.new
|
15
|
+
Ramaze::Log.loggers << Ramaze::Logging::Logger::Informer.new($output)
|
15
16
|
|
16
17
|
describe "Adapter" do
|
18
|
+
ramaze ramaze_options ||= {}
|
17
19
|
behaves_like "http"
|
18
20
|
|
19
21
|
it 'should do a simple request' do
|
20
22
|
get('/').body.should == 'The index'
|
21
23
|
end
|
22
|
-
|
24
|
+
|
25
|
+
it 'should measure request processing time' do
|
26
|
+
Ramaze::Global.benchmarking = true
|
27
|
+
$output.string = ""
|
28
|
+
get('/')
|
29
|
+
$output.string.should =~ /request took/
|
30
|
+
Ramaze::Global.benchmarking = false
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should not measure request processing time' do
|
34
|
+
Ramaze::Global.benchmarking = false
|
35
|
+
$output.string = ""
|
36
|
+
get('/')
|
37
|
+
$output.string.should.not =~ /request took/
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should allow using an Adapter.before block' do
|
41
|
+
Ramaze::Adapter.before do |env|
|
42
|
+
[ 200, {'Content-Type'=>'text/plain'}, 'i am before' ]
|
43
|
+
end
|
44
|
+
|
45
|
+
ret = get('/')
|
46
|
+
ret.status.should == 200
|
47
|
+
ret.body.should == 'i am before'
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
|
6
|
+
spec_require 'ebb'
|
7
|
+
|
8
|
+
def ramaze_options
|
9
|
+
{ :adapter => :ebb }
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'spec/ramaze/adapter'
|
data/spec/ramaze/cache.rb
CHANGED
@@ -14,12 +14,12 @@ end
|
|
14
14
|
|
15
15
|
caches.each do |cache, name|
|
16
16
|
describe "#{name} setup" do
|
17
|
-
|
17
|
+
should 'be assignable to Global' do
|
18
18
|
Ramaze::Global.cache = cache
|
19
19
|
Ramaze::Global.cache.to_s.should == name
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
should 'do .new' do
|
23
23
|
@cache = Ramaze::Global.cache.new
|
24
24
|
@cache.class.name.should == name
|
25
25
|
end
|
@@ -35,39 +35,106 @@ caches.each do |cache, name|
|
|
35
35
|
@cache.clear
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
should 'be assignable with #[]=' do
|
39
39
|
@cache[:foo] = :bar
|
40
40
|
@cache[:foo].should == :bar
|
41
41
|
end
|
42
42
|
|
43
|
-
|
43
|
+
should 'be retrievable with #[]' do
|
44
44
|
@cache[:yoh] = :bar
|
45
45
|
@cache[:yoh].should == :bar
|
46
46
|
end
|
47
47
|
|
48
|
-
|
48
|
+
should 'delete keys' do
|
49
49
|
@cache[:bar] = :duh
|
50
50
|
@cache.delete(:bar)
|
51
51
|
@cache[:bar].should == nil
|
52
52
|
end
|
53
53
|
|
54
|
-
|
54
|
+
should 'show values for multiple keys' do
|
55
55
|
@cache[:baz] = :foo
|
56
56
|
@cache[:beh] = :feh
|
57
57
|
@cache.values_at(:baz, :beh).should == [:foo, :feh]
|
58
58
|
end
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
FileUtils.rm(@cache.file) if cache == :yaml
|
61
|
+
end
|
62
|
+
end
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
describe "Cache wrapper" do
|
65
|
+
before do
|
66
|
+
@cache = Ramaze::Cache.new(Hash)
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
69
|
+
after do
|
70
|
+
@cache.clear
|
71
|
+
end
|
70
72
|
|
71
|
-
|
73
|
+
should 'be assignable with #[]= and retrievable with #[]' do
|
74
|
+
@cache[:foo] = :bar
|
75
|
+
@cache[:foo].should == :bar
|
76
|
+
end
|
77
|
+
|
78
|
+
should 'return nil if key not found' do
|
79
|
+
@cache[:baz].should == nil
|
80
|
+
end
|
81
|
+
|
82
|
+
should 'be assignable with #store and retrievable with #fetch' do
|
83
|
+
@cache.store(:foo, :bar)
|
84
|
+
@cache.fetch(:foo).should == :bar
|
85
|
+
end
|
86
|
+
|
87
|
+
should 'return default value if key not found' do
|
88
|
+
@cache.fetch(:monkeys, :default).should == :default
|
89
|
+
end
|
90
|
+
|
91
|
+
should 'be assignable with #set and retrievable with #get' do
|
92
|
+
@cache.set(:ninjas, :totally_sweet)
|
93
|
+
@cache.get(:ninjas).should == :totally_sweet
|
94
|
+
end
|
95
|
+
|
96
|
+
should 'expire key after ttl' do
|
97
|
+
@cache[:cow].should == nil
|
98
|
+
@cache.store(:cow, :moo, :ttl => 1)
|
99
|
+
@cache[:cow].should == :moo
|
100
|
+
sleep(1.1)
|
101
|
+
@cache[:cow].should == nil
|
102
|
+
end
|
103
|
+
|
104
|
+
should 'accept an int as the ttl parameter for #store' do
|
105
|
+
@cache[:cow].should == nil
|
106
|
+
@cache.store(:cow, :moo, 1)
|
107
|
+
@cache[:cow].should == :moo
|
108
|
+
end
|
109
|
+
|
110
|
+
should 'delete keys' do
|
111
|
+
@cache[:abc] = :cba
|
112
|
+
@cache[:def] = :fed
|
113
|
+
@cache.delete(:abc, :def)
|
114
|
+
@cache[:abc].should == nil
|
115
|
+
@cache[:def].should == nil
|
116
|
+
end
|
117
|
+
|
118
|
+
should 'show values for multiple keys' do
|
119
|
+
@cache[:baz] = :foo
|
120
|
+
@cache[:beh] = :feh
|
121
|
+
@cache.values_at(:baz, :beh).should == [:foo, :feh]
|
122
|
+
end
|
123
|
+
|
124
|
+
should 'clear' do
|
125
|
+
@cache[:moo] = :cow
|
126
|
+
@cache.clear
|
127
|
+
@cache[:moo].should == nil
|
128
|
+
end
|
129
|
+
|
130
|
+
should 'not allow different cache namespaces to overlap' do
|
131
|
+
Ramaze::Cache.add :foo
|
132
|
+
Ramaze::Cache.add :bar
|
133
|
+
|
134
|
+
key = "foobar"
|
135
|
+
Ramaze::Cache.foo[key] = 'foo'
|
136
|
+
Ramaze::Cache.bar[key] = 'bar'
|
137
|
+
|
138
|
+
Ramaze::Cache.foo[key].should.not == Ramaze::Cache.bar[key]
|
72
139
|
end
|
73
140
|
end
|
data/spec/ramaze/controller.rb
CHANGED
@@ -5,7 +5,7 @@ require 'spec/helper'
|
|
5
5
|
|
6
6
|
class TCControllerController < Ramaze::Controller
|
7
7
|
map '/'
|
8
|
-
|
8
|
+
view_root 'spec/ramaze/template/ezamar'
|
9
9
|
|
10
10
|
def index
|
11
11
|
@text = "World"
|
@@ -114,9 +114,12 @@ describe "Controller" do
|
|
114
114
|
],
|
115
115
|
}
|
116
116
|
|
117
|
-
it "dry
|
117
|
+
it "dry patterns_for" do
|
118
118
|
@hash.each do |path, correct|
|
119
|
-
patterns =
|
119
|
+
patterns = []
|
120
|
+
Ramaze::Controller.patterns_for(path) do |controller, action, params|
|
121
|
+
patterns << [controller, action, params]
|
122
|
+
end
|
120
123
|
patterns.should == correct
|
121
124
|
end
|
122
125
|
end
|