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
@@ -11,6 +11,12 @@ module Ramaze
|
|
11
11
|
# to touch this class at all.
|
12
12
|
class Flash
|
13
13
|
include Enumerable
|
14
|
+
|
15
|
+
def initialize sess
|
16
|
+
@session = sess
|
17
|
+
end
|
18
|
+
|
19
|
+
# iterate over the combined session
|
14
20
|
def each(&block)
|
15
21
|
combined.each(&block)
|
16
22
|
end
|
@@ -55,12 +61,18 @@ module Ramaze
|
|
55
61
|
current.delete(key)
|
56
62
|
end
|
57
63
|
|
64
|
+
# check if combined is empty
|
65
|
+
|
66
|
+
def empty?
|
67
|
+
combined.empty?
|
68
|
+
end
|
69
|
+
|
58
70
|
private
|
59
71
|
|
60
|
-
#
|
72
|
+
# Associated session object
|
61
73
|
|
62
74
|
def session
|
63
|
-
|
75
|
+
@session
|
64
76
|
end
|
65
77
|
end
|
66
78
|
end
|
@@ -9,7 +9,8 @@ module Ramaze
|
|
9
9
|
|
10
10
|
# Sets @hash to an empty Hash
|
11
11
|
|
12
|
-
def initialize
|
12
|
+
def initialize sess
|
13
|
+
@session = sess
|
13
14
|
@hash = {}
|
14
15
|
end
|
15
16
|
|
@@ -20,7 +21,7 @@ module Ramaze
|
|
20
21
|
old = @hash.dup
|
21
22
|
result = @hash.send(*args, &block)
|
22
23
|
unless old == @hash
|
23
|
-
Cache.sessions[
|
24
|
+
Cache.sessions[@session.session_id] = self
|
24
25
|
end
|
25
26
|
result
|
26
27
|
end
|
data/lib/ramaze/dispatcher.rb
CHANGED
@@ -31,6 +31,11 @@ module Ramaze
|
|
31
31
|
def handle
|
32
32
|
path = request.path_info.squeeze('/')
|
33
33
|
|
34
|
+
if new_path = Rewrite.resolve(path)
|
35
|
+
path = new_path
|
36
|
+
Log.dev("Rewriting `#{path}' to `#{path}'")
|
37
|
+
end
|
38
|
+
|
34
39
|
case path
|
35
40
|
when *Global.ignore
|
36
41
|
unless ::File.exist?(Dispatcher::File.resolve_path(path))
|
@@ -39,11 +44,8 @@ module Ramaze
|
|
39
44
|
end
|
40
45
|
|
41
46
|
general_dispatch path
|
42
|
-
rescue Object =>
|
43
|
-
|
44
|
-
:request => request,
|
45
|
-
:controller => Thread.current[:controller] }
|
46
|
-
Dispatcher::Error.process(error, meta)
|
47
|
+
rescue Object => exception
|
48
|
+
error(exception)
|
47
49
|
end
|
48
50
|
|
49
51
|
# protects against recursive dispatch and reassigns the path_info in the
|
@@ -103,21 +105,32 @@ module Ramaze
|
|
103
105
|
}
|
104
106
|
end
|
105
107
|
|
106
|
-
# Calls .
|
108
|
+
# Calls .call(path) on every object in Dispatcher::FILTER until one
|
107
109
|
# returns something else than false/nil.
|
108
110
|
|
109
111
|
def filter(path)
|
110
112
|
result = nil
|
111
113
|
FILTER.each do |dispatcher|
|
112
|
-
result = dispatcher.
|
114
|
+
result = dispatcher.call(path)
|
113
115
|
return result if result and not result.respond_to?(:exception)
|
114
116
|
end
|
115
117
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
error(result, :path => path)
|
119
|
+
end
|
120
|
+
|
121
|
+
def error(obj, meta = {})
|
122
|
+
controller = Thread.current[:controller]
|
123
|
+
meta[:controller] ||= controller if controller
|
124
|
+
|
125
|
+
if Global.middleware
|
126
|
+
message = "No action for '#{meta[:path]}'"
|
127
|
+
message << " on '#{CGI.escapeHTML(controller.to_s)}'" if controller
|
128
|
+
|
129
|
+
raise(obj) if obj.respond_to?(:message)
|
130
|
+
raise(Ramaze::Error, message)
|
131
|
+
else
|
132
|
+
Dispatcher::Error.call(obj, meta)
|
133
|
+
end
|
121
134
|
end
|
122
135
|
end
|
123
136
|
end
|
@@ -22,18 +22,27 @@ module Ramaze
|
|
22
22
|
# success. The response is then passed to each member of FILTER for
|
23
23
|
# post-processing.
|
24
24
|
|
25
|
-
def
|
26
|
-
|
25
|
+
def call(path)
|
26
|
+
log(path)
|
27
27
|
|
28
28
|
catch(:respond) {
|
29
29
|
body = Controller.handle(path)
|
30
|
-
|
30
|
+
Response.current.build(body)
|
31
31
|
}
|
32
|
+
|
32
33
|
FILTER.each{|f| f.call(response)}
|
33
34
|
response
|
34
35
|
rescue Ramaze::Error => ex
|
35
36
|
ex
|
36
37
|
end
|
38
|
+
|
39
|
+
def log(path)
|
40
|
+
case path
|
41
|
+
when *Global.boring
|
42
|
+
else
|
43
|
+
Log.info("Dynamic request from #{request.ip}: #{request.request_uri}")
|
44
|
+
end
|
45
|
+
end
|
37
46
|
end
|
38
47
|
end
|
39
48
|
end
|
@@ -12,7 +12,7 @@ module Ramaze
|
|
12
12
|
# Entry point from Dispatcher::filter.
|
13
13
|
# Just a forwarder to build_listing, automatticly exiting if there is
|
14
14
|
# an error (defined by returning false in build_listing)
|
15
|
-
def
|
15
|
+
def call(path)
|
16
16
|
if Global.list_directories
|
17
17
|
response = build_listing(path)
|
18
18
|
Response.current.build(*response) if response
|
@@ -27,6 +27,7 @@ module Ramaze
|
|
27
27
|
|
28
28
|
if ::File.directory?(dir)
|
29
29
|
Log.debug("Serving directory listing: #{dir}")
|
30
|
+
Session.current.drop! if Session.current
|
30
31
|
|
31
32
|
status = Ramaze::STATUS_CODE['OK']
|
32
33
|
header = {'Content-Type' => "text/html"}
|
@@ -35,6 +36,8 @@ module Ramaze
|
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
39
|
+
# Nicely formatted listing for given path, template is "stolen" from
|
40
|
+
# lighttpd
|
38
41
|
def list_for(path)
|
39
42
|
root = ::File.expand_path(Global.public_root)
|
40
43
|
display = path.gsub(/^#{Regexp.escape(root)}\/?/, '/')
|
@@ -29,7 +29,7 @@ module Ramaze
|
|
29
29
|
# In case metainfo has a controller we try to get the action for the
|
30
30
|
# path on it, dispatching there if we find one.
|
31
31
|
# Otherwise a plain-text error message is set as response.
|
32
|
-
def
|
32
|
+
def call(error, metainfo = {})
|
33
33
|
log_error(error)
|
34
34
|
|
35
35
|
Thread.current[:exception] = error
|
@@ -41,7 +41,7 @@ module Ramaze
|
|
41
41
|
|
42
42
|
if controller = metainfo[:controller]
|
43
43
|
newpath = (controller.mapping + path).squeeze('/')
|
44
|
-
action_response = Dispatcher::Action.
|
44
|
+
action_response = Dispatcher::Action.call(newpath)
|
45
45
|
case action_response
|
46
46
|
when Ramaze::Error
|
47
47
|
Log.debug("No custom error page found on #{controller}, going to #{path}")
|
@@ -62,7 +62,7 @@ module Ramaze
|
|
62
62
|
begin
|
63
63
|
m = ex.message
|
64
64
|
c = ex.class
|
65
|
-
b =
|
65
|
+
b = [ex.backtrace].flatten.join("\n")
|
66
66
|
body = <<-html
|
67
67
|
==== Error ====\n
|
68
68
|
#{ m } (#{ c })
|
@@ -21,8 +21,9 @@ module Ramaze
|
|
21
21
|
# Entry point from Dispatcher::filter.
|
22
22
|
# searches for the file and builds a response with status 200 if found.
|
23
23
|
|
24
|
-
def
|
24
|
+
def call(path)
|
25
25
|
return unless file = open_file(CGI.unescape(path))
|
26
|
+
Session.current.drop! if Session.current
|
26
27
|
if file == :NotModified
|
27
28
|
return response.build([], STATUS_CODE['Not Modified'])
|
28
29
|
end
|
@@ -34,8 +35,8 @@ module Ramaze
|
|
34
35
|
|
35
36
|
def open_file(path)
|
36
37
|
file = resolve_path(path)
|
37
|
-
|
38
|
-
if ::File.file?(file)
|
38
|
+
|
39
|
+
if ::File.file?(file)
|
39
40
|
return unless in_public?(file)
|
40
41
|
response['Content-Type'] = Tool::MIME.type_for(file) unless ::File.extname(file).empty?
|
41
42
|
mtime = ::File.mtime(file)
|
@@ -54,6 +55,11 @@ module Ramaze
|
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
58
|
+
# If path matches a directory in public_root, return that directory path, unless
|
59
|
+
# there is an index file in that directory, in which case return path for that.
|
60
|
+
# If path is not a directory, simply return given path in public_root.
|
61
|
+
# Either way, the returned path always starts with public_root.
|
62
|
+
|
57
63
|
def resolve_path(path)
|
58
64
|
joined = ::File.join(Global.public_root, path)
|
59
65
|
|
@@ -64,6 +70,8 @@ module Ramaze
|
|
64
70
|
end
|
65
71
|
end
|
66
72
|
|
73
|
+
# Determine whether a path is in the public directory for better
|
74
|
+
# security.
|
67
75
|
def in_public?(path)
|
68
76
|
expand(path).start_with?(expand(Global.public_root))
|
69
77
|
end
|
data/lib/ramaze/gestalt.rb
CHANGED
@@ -95,7 +95,7 @@ module Ramaze
|
|
95
95
|
|
96
96
|
def _gestalt_build_tag name, attr={}, text=[]
|
97
97
|
@out << "<#{name}"
|
98
|
-
@out << attr.
|
98
|
+
@out << attr.map{|k,v| %[ #{k}="#{_gestalt_escape_entities(v)}"] }.join
|
99
99
|
if text != [] or block_given?
|
100
100
|
@out << ">"
|
101
101
|
@out << _gestalt_escape_entities([text].join)
|
data/lib/ramaze/helper.rb
CHANGED
@@ -11,12 +11,23 @@ module Ramaze
|
|
11
11
|
|
12
12
|
module Helper
|
13
13
|
LOOKUP = Set.new
|
14
|
+
PATH = ['']
|
14
15
|
trait :ignore => [
|
15
16
|
/#{Regexp.escape(File.expand_path(BASEDIR/'../spec/ramaze/helper/'))}\//
|
16
17
|
]
|
17
18
|
|
18
19
|
module Methods
|
19
|
-
|
20
|
+
def self.included other
|
21
|
+
other.send :extend, Trinity
|
22
|
+
other.send :extend, Methods
|
23
|
+
other.send :include, Trinity
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.extend_object other
|
28
|
+
other.send :extend, Trinity
|
29
|
+
super
|
30
|
+
end
|
20
31
|
|
21
32
|
# This loads the helper-files from /ramaze/helper/helpername.rb and
|
22
33
|
# includes it into Ramaze::Template (or wherever it is called)
|
@@ -39,22 +50,19 @@ module Ramaze
|
|
39
50
|
end
|
40
51
|
end
|
41
52
|
|
42
|
-
|
53
|
+
private
|
54
|
+
|
43
55
|
def find_helper(name)
|
56
|
+
name = name.to_s.camel_case
|
44
57
|
ramaze_helper_consts = ::Ramaze::Helper.constants.grep(/^#{name}$/i)
|
45
|
-
ramaze_consts = ::Ramaze.constants.grep(/^#{name}Helper$/i)
|
46
58
|
if mod_name = ramaze_helper_consts.first
|
47
59
|
::Ramaze::Helper.const_get(mod_name)
|
48
|
-
elsif mod_name = ramaze_consts.first
|
49
|
-
mod = ::Ramaze.const_get(mod_name)
|
50
|
-
new_name = "Ramaze::Helper::" << mod_name.split('::').last[/^(.*)Helper$/, 1]
|
51
|
-
Log.warn "#{mod_name} is being deprecated, use #{new_name} instead"
|
52
|
-
mod
|
53
60
|
end
|
54
61
|
end
|
55
62
|
|
56
63
|
def require_helper(name)
|
57
|
-
|
64
|
+
paths = (PATH + [Global.root, BASEDIR/:ramaze]).join(',')
|
65
|
+
glob = "{#{paths}}/helper/#{name}.{so,bundle,rb}"
|
58
66
|
files = Dir[glob]
|
59
67
|
ignore = Helper.trait[:ignore]
|
60
68
|
files.reject!{|f| ignore.any?{|i| f =~ i }}
|
@@ -66,18 +74,6 @@ module Ramaze
|
|
66
74
|
include mod
|
67
75
|
extend mod
|
68
76
|
end
|
69
|
-
|
70
|
-
def Methods.included other
|
71
|
-
other.send :extend, Trinity
|
72
|
-
other.send :include, Trinity
|
73
|
-
other.send :extend, Methods
|
74
|
-
super
|
75
|
-
end
|
76
|
-
|
77
|
-
def Methods.extend_object other
|
78
|
-
other.send :extend, Trinity
|
79
|
-
super
|
80
|
-
end
|
81
77
|
end
|
82
78
|
end
|
83
79
|
end
|
data/lib/ramaze/helper/aspect.rb
CHANGED
@@ -8,10 +8,6 @@ module Ramaze
|
|
8
8
|
#
|
9
9
|
# For examples please look at the spec/ramaze/helper/aspect.rb
|
10
10
|
#
|
11
|
-
# This is not a default helper due to the possible performance-issues.
|
12
|
-
# However, it should be only an overhead of about 6-8 calls, so if you
|
13
|
-
# want this feature it shouldn't have too large impact ;)
|
14
|
-
#
|
15
11
|
# Like every other helper, you can use it in your controller with:
|
16
12
|
#
|
17
13
|
# helper :aspect
|
@@ -21,7 +17,7 @@ module Ramaze
|
|
21
17
|
private
|
22
18
|
|
23
19
|
# lazily and smartly inherit copy of aspects trait from parent, or
|
24
|
-
# bootstrap our own
|
20
|
+
# bootstrap our own
|
25
21
|
def aspects
|
26
22
|
trait[:aspects] ||= (
|
27
23
|
if hash = ancestral_trait[:aspects]
|
@@ -80,21 +76,31 @@ module Ramaze
|
|
80
76
|
class Action
|
81
77
|
|
82
78
|
# overwrites the default Action hook and runs the neccesary blocks in its
|
83
|
-
# scope.
|
79
|
+
# scope. before actions are run starting from Ramaze::Controller down the
|
80
|
+
# ancestor chain.
|
84
81
|
def before_process
|
85
|
-
|
86
|
-
[ aspects[:before][name], aspects[:before][:all] ].compact.map do |block|
|
87
|
-
instance.instance_eval(&block) if block
|
88
|
-
end
|
82
|
+
common_aspect(:before)
|
89
83
|
end
|
90
84
|
|
85
|
+
|
91
86
|
# overwrites the default Action hook and runs the neccesary blocks in its
|
92
|
-
# scope.
|
87
|
+
# scope. before actions are run starting from Ramaze::Controller down the
|
88
|
+
# ancestor chain.
|
93
89
|
def after_process
|
94
|
-
|
95
|
-
|
96
|
-
|
90
|
+
common_aspect(:after)
|
91
|
+
end
|
92
|
+
|
93
|
+
def common_aspect(aspect)
|
94
|
+
return unless path
|
95
|
+
|
96
|
+
controller.relevant_ancestors.reverse_each do |controller|
|
97
|
+
next unless aspects = controller.trait[:aspects]
|
98
|
+
|
99
|
+
[ aspects[aspect][name], aspects[aspect][:all] ].compact.map do |block|
|
100
|
+
instance.instance_eval(&block) if block
|
101
|
+
end
|
97
102
|
end
|
98
103
|
end
|
104
|
+
|
99
105
|
end
|
100
106
|
end
|
data/lib/ramaze/helper/auth.rb
CHANGED
@@ -32,7 +32,7 @@ module Ramaze
|
|
32
32
|
session[:username] = username
|
33
33
|
inside_stack? ? answer : redirect_referrer
|
34
34
|
else
|
35
|
-
if AUTH_ELEMENT and AUTH_ELEMENT.to_s.split.any?
|
35
|
+
if defined? AUTH_ELEMENT and AUTH_ELEMENT.to_s.split.any?
|
36
36
|
open_element = "<#{AUTH_ELEMENT}>"
|
37
37
|
close_element = "</#{AUTH_ELEMENT}>"
|
38
38
|
end
|
data/lib/ramaze/helper/cache.rb
CHANGED
@@ -44,13 +44,10 @@ module Ramaze
|
|
44
44
|
def cache *args
|
45
45
|
return value_cache if args.size == 0
|
46
46
|
|
47
|
-
|
48
|
-
opts = args.pop
|
49
|
-
end
|
50
|
-
opts ||= {}
|
47
|
+
opts = args.last.is_a?(Hash) ? args.pop : {}
|
51
48
|
|
52
|
-
args.each do |arg|
|
53
|
-
actions_cached[arg.to_sym] = opts
|
49
|
+
args.compact.each do |arg|
|
50
|
+
actions_cached[arg.to_sym] = opts
|
54
51
|
end
|
55
52
|
end
|
56
53
|
|
data/lib/ramaze/helper/cgi.rb
CHANGED
@@ -31,13 +31,17 @@ module Ramaze
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# safely escape all HTML and code
|
34
|
-
def
|
34
|
+
def h(string)
|
35
35
|
::CGI.escapeHTML(string.to_s).gsub(/#/, '#')
|
36
36
|
end
|
37
37
|
|
38
|
+
def c(string)
|
39
|
+
Ramaze::deprecated("Helper::CGI#c", "Helper::CGI#h")
|
40
|
+
h(string)
|
41
|
+
end
|
42
|
+
|
38
43
|
# one-letter versions help in case like #{h foo.inspect}
|
39
44
|
# ERb/ERuby/Rails compatible
|
40
45
|
alias u url_encode
|
41
|
-
alias h c
|
42
46
|
end
|
43
47
|
end
|
data/lib/ramaze/helper/flash.rb
CHANGED
@@ -23,7 +23,7 @@ module Ramaze
|
|
23
23
|
# On the request after this, flash[:error] is gone.
|
24
24
|
|
25
25
|
module Helper::Flash
|
26
|
-
trait :
|
26
|
+
trait :flashbox => "<div class='flash' id='flash_%key'>%value</div>"
|
27
27
|
# answers with Session.current.flash
|
28
28
|
|
29
29
|
def flash
|
@@ -48,12 +48,12 @@ module Ramaze
|
|
48
48
|
# Where any occurrence of %key and %value will be replaced by the actual
|
49
49
|
# contents of each element of flash
|
50
50
|
|
51
|
-
def flashbox(tag =
|
52
|
-
flash.map{|key,
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
}.join("\n")
|
51
|
+
def flashbox(tag = ancestral_trait[:flashbox])
|
52
|
+
flash.map{|key, *values|
|
53
|
+
values.flatten.map do |value|
|
54
|
+
tag.gsub(/%key/, key.to_s).gsub(/%value/, value.to_s)
|
55
|
+
end
|
56
|
+
}.flatten.join("\n")
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|