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/lib/proto/spec/main.rb
CHANGED
data/lib/proto/start.ru
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
+
#!/usr/bin/env rackup
|
1
2
|
# start.ru for ramaze apps
|
2
3
|
# use thin>=0.6.3
|
3
4
|
# thin start -r start.ru
|
5
|
+
#
|
6
|
+
# rackup is a useful tool for running Rack applications, which uses the
|
7
|
+
# Rack::Builder DSL to configure middleware and build up applications easily.
|
8
|
+
#
|
9
|
+
# rackup automatically figures out the environment it is run in, and runs your
|
10
|
+
# application as FastCGI, CGI, or standalone with Mongrel or WEBrick—all from
|
11
|
+
# the same configuration.
|
4
12
|
|
5
13
|
require 'start'
|
6
14
|
Ramaze.trait[:essentials].delete Ramaze::Adapter
|
data/lib/proto/view/page.xhtml
CHANGED
@@ -1,6 +1,18 @@
|
|
1
|
-
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
5
|
<head>
|
3
6
|
<title>#{@title}</title>
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<meta http-equiv="Content-Style-Type" content="text/css" />
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="expires" content="0" />
|
11
|
+
<meta name="description" content="Description for search engines" />
|
12
|
+
<meta name="generator" content="Ramaze #{Ramaze::VERSION}" />
|
13
|
+
<meta name="keywords" content="Ramaze, Your own keywords" />
|
14
|
+
<meta name="author" content="Max Mustermann" />
|
15
|
+
<meta name="date" content="#{Time.now.iso8601}" />
|
4
16
|
<style type="text/css">
|
5
17
|
body { margin: 2em; }
|
6
18
|
#content { margin-left: 2em; }
|
data/lib/ramaze.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
|
4
4
|
# StdLib
|
5
5
|
require 'abbrev'
|
6
|
-
require 'benchmark'
|
7
6
|
require 'cgi'
|
8
7
|
require 'digest/md5'
|
9
8
|
require 'fileutils'
|
@@ -31,8 +30,6 @@ require 'rack/response'
|
|
31
30
|
|
32
31
|
# The main namespace for Ramaze
|
33
32
|
module Ramaze
|
34
|
-
SEEED = $0.dup
|
35
|
-
APPDIR = File.dirname(File.expand_path($0))
|
36
33
|
BASEDIR = File.dirname(File.expand_path(__FILE__))
|
37
34
|
$LOAD_PATH.unshift BASEDIR
|
38
35
|
$LOAD_PATH.uniq!
|
@@ -42,18 +39,18 @@ Thread.abort_on_exception = true
|
|
42
39
|
|
43
40
|
# Bootstrap
|
44
41
|
require 'ramaze/version'
|
42
|
+
require 'ramaze/sourcereload'
|
45
43
|
require 'ramaze/snippets'
|
46
44
|
require 'ramaze/log'
|
47
45
|
require 'ramaze/trinity'
|
48
46
|
require 'ramaze/current'
|
49
47
|
require 'ramaze/adapter'
|
50
|
-
require 'ramaze/
|
48
|
+
require 'ramaze/option'
|
51
49
|
require 'ramaze/cache'
|
52
50
|
require 'ramaze/tool'
|
53
51
|
|
54
52
|
# Startup
|
55
53
|
require 'ramaze/controller'
|
56
|
-
require 'ramaze/sourcereload'
|
57
54
|
|
58
55
|
# Complete
|
59
56
|
require 'ramaze/dispatcher'
|
@@ -69,39 +66,59 @@ module Ramaze
|
|
69
66
|
Global, Cache, Contrib, Controller, Session, SourceReload, Adapter
|
70
67
|
]
|
71
68
|
|
69
|
+
trait :started => false
|
70
|
+
|
72
71
|
class << self
|
73
72
|
|
74
73
|
# The one place to start Ramaze, takes an Hash of options to pass on to
|
75
74
|
# each class in trait[:essentials] by calling ::startup on them.
|
76
75
|
|
77
76
|
def startup options = {}
|
78
|
-
|
79
|
-
|
77
|
+
force = options.delete(:force)
|
78
|
+
force ||= !trait[:started]
|
79
|
+
|
80
|
+
options[:runner] ||= caller[0][/^(.*?):\d+/, 1]
|
81
|
+
Global.merge!(options)
|
80
82
|
|
81
|
-
if
|
83
|
+
if force
|
82
84
|
Log.info("Starting up Ramaze (Version #{VERSION})")
|
83
|
-
|
84
|
-
APPDIR.replace(File.dirname(File.expand_path(runner)))
|
85
|
+
trait[:started] = true
|
85
86
|
|
86
87
|
trait[:essentials].each do |obj|
|
87
88
|
obj.startup(options)
|
88
89
|
end
|
89
90
|
else
|
90
|
-
|
91
|
+
Log.info "Ramaze already started, skipped start."
|
91
92
|
end
|
92
93
|
end
|
93
94
|
|
95
|
+
def skip_start
|
96
|
+
trait[:started] = true
|
97
|
+
end
|
98
|
+
|
99
|
+
def start!(options = {})
|
100
|
+
trait[:started] = false
|
101
|
+
startup(options)
|
102
|
+
end
|
103
|
+
|
94
104
|
# This will be called when you hit ^C or send SIGINT.
|
95
105
|
# It sends ::shutdown to every class in trait[:essentials] and informs you
|
96
106
|
# when it is done
|
97
107
|
|
98
108
|
def shutdown
|
99
|
-
|
100
|
-
|
101
|
-
|
109
|
+
Log.info "Initiate shutdown"
|
110
|
+
|
111
|
+
Timeout.timeout(5) do
|
112
|
+
trait[:essentials].each do |obj|
|
113
|
+
obj.shutdown if obj.respond_to?(:shutdown)
|
114
|
+
end
|
102
115
|
|
103
|
-
|
116
|
+
puts "Ramazement is over, have a nice day."
|
104
117
|
|
118
|
+
exit
|
119
|
+
end
|
120
|
+
rescue Timeout::Error
|
121
|
+
puts "Shutdown timed out, issuing exit!"
|
105
122
|
exit!
|
106
123
|
end
|
107
124
|
|
data/lib/ramaze/action.rb
CHANGED
@@ -39,6 +39,7 @@ module Ramaze
|
|
39
39
|
stack.last
|
40
40
|
end
|
41
41
|
|
42
|
+
# Return the stacked actions for the current request
|
42
43
|
def stack
|
43
44
|
Thread.current[:action_stack] ||= []
|
44
45
|
end
|
@@ -108,13 +109,18 @@ module Ramaze
|
|
108
109
|
self[:binding] ||= instance.instance_eval{ binding }
|
109
110
|
end
|
110
111
|
|
112
|
+
# Try to figure out a sane name for current action.
|
111
113
|
def name
|
112
114
|
File.basename((self[:method] || self[:template]).to_s).split('.').first
|
113
115
|
end
|
114
116
|
|
115
117
|
# combined path to current action, from path and params
|
116
118
|
def extended_path
|
117
|
-
|
119
|
+
Array[path, *params].join('/')
|
120
|
+
end
|
121
|
+
|
122
|
+
def full_path
|
123
|
+
self.controller.mapping/extended_path
|
118
124
|
end
|
119
125
|
|
120
126
|
# Hook for AspectHelper
|
@@ -126,6 +132,17 @@ module Ramaze
|
|
126
132
|
|
127
133
|
def after_process
|
128
134
|
end
|
135
|
+
|
136
|
+
def valid_rest?
|
137
|
+
return true unless rest = controller.trait[:REST]
|
138
|
+
meth = Request.current.request_method
|
139
|
+
|
140
|
+
return true if rest[:any].include?(name)
|
141
|
+
|
142
|
+
if rest.has_key?(meth)
|
143
|
+
rest[meth].include?(name)
|
144
|
+
end
|
145
|
+
end
|
129
146
|
end
|
130
147
|
|
131
148
|
# Shortcut to create new instances of Action via Action::fill
|
data/lib/ramaze/action/render.rb
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
module Ramaze
|
5
5
|
class Action
|
6
6
|
|
7
|
+
# Use your block and jump into the Action::stack - this allows you to call
|
8
|
+
# nested actions.
|
7
9
|
def stack
|
8
10
|
Action.stack << self
|
9
11
|
yield self
|
@@ -23,10 +25,16 @@ module Ramaze
|
|
23
25
|
|
24
26
|
def render
|
25
27
|
Log.dev("Action: #{self}")
|
26
|
-
|
27
28
|
stack do
|
28
29
|
if should_cache?
|
29
|
-
|
30
|
+
# Ignore cache if there is flash session data as the response probably
|
31
|
+
# expects to include it, making it unique for this user and request.
|
32
|
+
if Global.no_cache_flash && !Current.session.flash.empty?
|
33
|
+
Log.debug("Action caching ignored as session flash data is present.")
|
34
|
+
uncached_render
|
35
|
+
else
|
36
|
+
cached_render
|
37
|
+
end
|
30
38
|
else
|
31
39
|
uncached_render
|
32
40
|
end
|
@@ -48,6 +56,9 @@ module Ramaze
|
|
48
56
|
end
|
49
57
|
end
|
50
58
|
|
59
|
+
# Uses files in the Global.public_root to provide a static ressource on
|
60
|
+
# next request and returns the rendered action
|
61
|
+
|
51
62
|
def cached_render_file
|
52
63
|
rendered = uncached_render
|
53
64
|
|
@@ -58,29 +69,39 @@ module Ramaze
|
|
58
69
|
rendered
|
59
70
|
end
|
60
71
|
|
72
|
+
# Using memory to cache, more sophisticated in terms of control but limited
|
73
|
+
# in terms of your RAM.
|
74
|
+
|
61
75
|
def cached_render_memory
|
62
|
-
|
63
|
-
|
76
|
+
cache = Cache.actions
|
77
|
+
options = cache_options
|
78
|
+
store_options = {}
|
79
|
+
key = full_path
|
64
80
|
|
65
|
-
|
66
|
-
|
81
|
+
if options.respond_to?(:values_at)
|
82
|
+
block, ttl = options.values_at(:key, :ttl)
|
67
83
|
|
68
|
-
|
69
|
-
|
70
|
-
cache = action_cache[full_path][ cache_opts[:key].call ] ||= {}
|
71
|
-
else
|
72
|
-
cache = action_cache[full_path] ||= {}
|
84
|
+
key = [full_path, block.call] if block
|
85
|
+
store_options[:ttl] = ttl if ttl
|
73
86
|
end
|
74
87
|
|
75
|
-
|
76
|
-
|
77
|
-
|
88
|
+
cached_memory_process(cache, key, store_options)
|
89
|
+
end
|
90
|
+
|
91
|
+
def cached_memory_process(cache, key, store_options)
|
92
|
+
stored = cache[key] || {}
|
93
|
+
|
94
|
+
if content = stored[:content]
|
95
|
+
Log.debug "Action already cached"
|
96
|
+
Response.current['Content-Type'] = stored[:type]
|
78
97
|
else
|
79
|
-
Log.debug
|
80
|
-
|
98
|
+
Log.debug "Action will be rendered for caching"
|
99
|
+
stored[:content] = uncached_render
|
100
|
+
stored[:type] = Response.current['Content-Type']
|
101
|
+
cache.store(key, stored, store_options)
|
81
102
|
end
|
82
103
|
|
83
|
-
|
104
|
+
stored[:content]
|
84
105
|
end
|
85
106
|
|
86
107
|
# The 'normal' rendering process. Passes the Action instance to
|
@@ -144,10 +165,17 @@ module Ramaze
|
|
144
165
|
end
|
145
166
|
end
|
146
167
|
|
168
|
+
# List the cached actions, just a shortcut really
|
169
|
+
|
147
170
|
def actions_cached
|
148
171
|
controller.trait[:actions_cached]
|
149
172
|
end
|
150
173
|
|
174
|
+
# backwards compat with trait :actions_cached => []
|
175
|
+
def cache_options
|
176
|
+
actions_cached.is_a?(Hash) ? actions_cached[path.to_sym] : {}
|
177
|
+
end
|
178
|
+
|
151
179
|
# return true if the action is flagged for caching. Called by
|
152
180
|
# Action#render.
|
153
181
|
|
data/lib/ramaze/adapter.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
require 'ramaze/trinity'
|
5
5
|
require 'ramaze/tool/record'
|
6
6
|
require 'ramaze/adapter/base'
|
7
|
+
require 'ramaze/adapter/fake'
|
7
8
|
|
8
9
|
# for OSX compatibility
|
9
10
|
Socket.do_not_reverse_lookup = true
|
@@ -60,12 +61,13 @@ module Ramaze
|
|
60
61
|
end
|
61
62
|
|
62
63
|
adapter.start(host, port)
|
63
|
-
else
|
64
|
-
|
64
|
+
else
|
65
|
+
Fake.start
|
65
66
|
Log.warn("Seems like Global.adapter is turned off", "Continue without adapter.")
|
66
67
|
end
|
67
68
|
rescue LoadError => ex
|
68
|
-
Log.
|
69
|
+
Log.error(ex)
|
70
|
+
Log.warn("Continue without adapter.")
|
69
71
|
end
|
70
72
|
|
71
73
|
# Calls ::shutdown on all running adapters and waits up to 1 second for
|
@@ -73,13 +75,12 @@ module Ramaze
|
|
73
75
|
|
74
76
|
def shutdown
|
75
77
|
Timeout.timeout(3) do
|
76
|
-
|
77
|
-
|
78
|
+
if Global.server.respond_to?(:shutdown)
|
79
|
+
Global.server.shutdown
|
80
|
+
end
|
78
81
|
end
|
79
82
|
rescue Timeout::Error
|
80
83
|
Global.server.kill!
|
81
|
-
# Hard exit! because it won't be able to kill Webrick otherwise
|
82
|
-
exit!
|
83
84
|
end
|
84
85
|
|
85
86
|
# Opens a TCPServer temporarily and returns true if a connection is
|
data/lib/ramaze/adapter/base.rb
CHANGED
@@ -4,25 +4,79 @@
|
|
4
4
|
module Ramaze
|
5
5
|
module Adapter
|
6
6
|
|
7
|
+
# (Rack) middleware injected around Adapter::Base::call
|
8
|
+
MIDDLEWARE = OrderedSet.new(
|
9
|
+
Ramaze::Current,
|
10
|
+
Rack::ShowStatus,
|
11
|
+
Rack::ShowExceptions
|
12
|
+
)
|
13
|
+
|
14
|
+
# Helper to assign a new block to before_call
|
15
|
+
# Usage:
|
16
|
+
# Ramaze::Adapter.before do |env|
|
17
|
+
# if env['PATH_INFO'] =~ /suerpfast/
|
18
|
+
# [200, {'Content-Type' => 'text/plain'}, ['super fast!']]
|
19
|
+
# end
|
20
|
+
# end
|
21
|
+
|
22
|
+
def self.before(&block)
|
23
|
+
@before = block if block
|
24
|
+
@before
|
25
|
+
end
|
26
|
+
|
7
27
|
# This class is holding common behaviour for its subclasses.
|
8
28
|
|
9
29
|
class Base
|
10
30
|
class << self
|
31
|
+
attr_reader :thread
|
11
32
|
|
12
33
|
# For the specified host and for all given ports call run_server and
|
13
34
|
# add the returned thread to the Global.adapters ThreadGroup.
|
14
35
|
# Afterwards adds a trap for the value of Global.shutdown_trap which
|
15
36
|
# calls Ramaze.shutdown when triggered (usually by SIGINT).
|
16
37
|
|
17
|
-
def start
|
18
|
-
|
19
|
-
|
38
|
+
def start(host = nil, port = nil)
|
39
|
+
@thread = startup(host, port)
|
40
|
+
Global.server = self
|
41
|
+
|
42
|
+
trap(Global.shutdown_trap){
|
43
|
+
trap(Global.shutdown_trap){ exit! }
|
44
|
+
exit
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def start_server(host, port)
|
49
|
+
Ramaze::deprecated("Adapter::Base::start_server", "Adapter::Base::startup")
|
50
|
+
startup(host, port)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Does nothing by default
|
54
|
+
|
55
|
+
def shutdown
|
56
|
+
if @server.respond_to?(:stop)
|
57
|
+
Log.dev "Stopping @server"
|
58
|
+
@server.stop
|
59
|
+
else
|
60
|
+
Log.dev "Cannot stop @server, skipping this step."
|
61
|
+
end
|
20
62
|
end
|
21
63
|
|
22
|
-
|
64
|
+
def join
|
65
|
+
@thread.join
|
66
|
+
end
|
23
67
|
|
24
|
-
|
25
|
-
|
68
|
+
# Tries to find the block assigned by #before and calls it, logs and
|
69
|
+
# raises again any errors encountered during this process.
|
70
|
+
|
71
|
+
def before_call env
|
72
|
+
if Adapter.before
|
73
|
+
begin
|
74
|
+
Adapter.before.call(env)
|
75
|
+
rescue Object => e
|
76
|
+
Ramaze::Log.error e
|
77
|
+
raise e
|
78
|
+
end
|
79
|
+
end
|
26
80
|
end
|
27
81
|
|
28
82
|
# This is called by Rack with the usual env, subsequently calls
|
@@ -32,23 +86,35 @@ module Ramaze
|
|
32
86
|
# calls .finish on the current response after ::respond has finished.
|
33
87
|
|
34
88
|
def call(env)
|
35
|
-
returned =
|
36
|
-
|
89
|
+
if returned = before_call(env)
|
90
|
+
returned
|
91
|
+
elsif Global.benchmarking
|
92
|
+
require 'benchmark'
|
37
93
|
time = Benchmark.measure{ returned = respond(env) }
|
38
94
|
Log.debug('request took %.5fs [~%.0f r/s]' % [time.real, 1.0/time.real])
|
95
|
+
returned
|
39
96
|
else
|
40
|
-
|
97
|
+
respond(env)
|
41
98
|
end
|
42
|
-
returned
|
43
99
|
end
|
44
100
|
|
45
101
|
# Initializes Request with env and an empty Response. Records the
|
46
102
|
# request into Ramaze::Record if Global.record is true.
|
47
103
|
# Then goes on and calls Dispatcher::handle with request and response.
|
48
104
|
|
49
|
-
def respond
|
50
|
-
if Global.server == Thread.current
|
51
|
-
Thread.new{
|
105
|
+
def respond(env)
|
106
|
+
if Global.server.thread == Thread.current
|
107
|
+
Thread.new{ middleware_respond(env) }.value
|
108
|
+
else
|
109
|
+
middleware_respond(env)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def middleware_respond(env)
|
114
|
+
Thread.current.priority = 1
|
115
|
+
|
116
|
+
if Global.middleware
|
117
|
+
MIDDLEWARE.inject{|app, middleware| middleware.new(app) }.call(env)
|
52
118
|
else
|
53
119
|
Current.call(env)
|
54
120
|
end
|