Pistos-ramaze 2008.09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +481 -0
- data/Rakefile +228 -0
- 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 +80 -0
- data/doc/AUTHORS +29 -0
- data/doc/CHANGELOG +19530 -0
- data/doc/COPYING +56 -0
- data/doc/FAQ +92 -0
- data/doc/GPL +339 -0
- data/doc/INSTALL +92 -0
- data/doc/LEGAL +26 -0
- data/doc/TODO +29 -0
- data/doc/meta/announcement.txt +99 -0
- data/doc/meta/configuration.txt +163 -0
- data/doc/meta/internals.txt +278 -0
- data/doc/meta/users.kml +64 -0
- data/doc/readme_chunks/appendix.txt +10 -0
- data/doc/readme_chunks/examples.txt +38 -0
- data/doc/readme_chunks/features.txt +148 -0
- data/doc/readme_chunks/getting_help.txt +5 -0
- data/doc/readme_chunks/getting_started.txt +18 -0
- data/doc/readme_chunks/installing.txt +92 -0
- data/doc/readme_chunks/introduction.txt +18 -0
- data/doc/readme_chunks/principles.txt +56 -0
- data/doc/readme_chunks/thanks.txt +59 -0
- data/doc/tutorial/todolist.html +742 -0
- data/doc/tutorial/todolist.mkd +787 -0
- data/examples/app/auth/auth.rb +54 -0
- data/examples/app/auth/template/layout.haml +20 -0
- data/examples/app/auth/template/login.haml +16 -0
- data/examples/app/blog/README +3 -0
- data/examples/app/blog/controller/main.rb +29 -0
- data/examples/app/blog/model/entry.rb +30 -0
- data/examples/app/blog/public/styles/blog.css +132 -0
- data/examples/app/blog/spec/blog.rb +87 -0
- data/examples/app/blog/start.rb +7 -0
- data/examples/app/blog/view/edit.xhtml +17 -0
- data/examples/app/blog/view/index.xhtml +17 -0
- data/examples/app/blog/view/layout.xhtml +11 -0
- data/examples/app/blog/view/new.xhtml +16 -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/app/rapaste/Rakefile +34 -0
- data/examples/app/rapaste/controller/paste.rb +101 -0
- data/examples/app/rapaste/model/paste.rb +58 -0
- data/examples/app/rapaste/public/css/active4d.css +114 -0
- data/examples/app/rapaste/public/css/all_hallows_eve.css +72 -0
- data/examples/app/rapaste/public/css/amy.css +147 -0
- data/examples/app/rapaste/public/css/blackboard.css +88 -0
- data/examples/app/rapaste/public/css/brilliance_black.css +605 -0
- data/examples/app/rapaste/public/css/brilliance_dull.css +599 -0
- data/examples/app/rapaste/public/css/cobalt.css +149 -0
- data/examples/app/rapaste/public/css/dawn.css +121 -0
- data/examples/app/rapaste/public/css/display.css +197 -0
- data/examples/app/rapaste/public/css/eiffel.css +121 -0
- data/examples/app/rapaste/public/css/espresso_libre.css +109 -0
- data/examples/app/rapaste/public/css/idle.css +62 -0
- data/examples/app/rapaste/public/css/iplastic.css +80 -0
- data/examples/app/rapaste/public/css/lazy.css +73 -0
- data/examples/app/rapaste/public/css/mac_classic.css +123 -0
- data/examples/app/rapaste/public/css/magicwb_amiga.css +104 -0
- data/examples/app/rapaste/public/css/pastels_on_dark.css +188 -0
- data/examples/app/rapaste/public/css/slush_poppies.css +85 -0
- data/examples/app/rapaste/public/css/spacecadet.css +51 -0
- data/examples/app/rapaste/public/css/sunburst.css +180 -0
- data/examples/app/rapaste/public/css/twilight.css +137 -0
- data/examples/app/rapaste/public/css/zenburnesque.css +91 -0
- data/examples/app/rapaste/public/js/jquery.js +11 -0
- data/examples/app/rapaste/spec/rapaste.rb +51 -0
- data/examples/app/rapaste/start.rb +25 -0
- data/examples/app/rapaste/view/copy.xhtml +10 -0
- data/examples/app/rapaste/view/index.xhtml +9 -0
- data/examples/app/rapaste/view/layout.xhtml +25 -0
- data/examples/app/rapaste/view/list.xhtml +29 -0
- data/examples/app/rapaste/view/search.xhtml +41 -0
- data/examples/app/rapaste/view/view.xhtml +37 -0
- data/examples/app/sourceview/public/coderay.css +104 -0
- data/examples/app/sourceview/public/images/file.gif +0 -0
- data/examples/app/sourceview/public/images/folder.gif +0 -0
- data/examples/app/sourceview/public/images/tv-collapsable-last.gif +0 -0
- data/examples/app/sourceview/public/images/tv-collapsable.gif +0 -0
- data/examples/app/sourceview/public/images/tv-expandable-last.gif +0 -0
- data/examples/app/sourceview/public/images/tv-expandable.gif +0 -0
- data/examples/app/sourceview/public/images/tv-item-last.gif +0 -0
- data/examples/app/sourceview/public/images/tv-item.gif +0 -0
- data/examples/app/sourceview/public/jquery.js +11 -0
- data/examples/app/sourceview/public/jquery.treeview.css +48 -0
- data/examples/app/sourceview/public/jquery.treeview.js +223 -0
- data/examples/app/sourceview/public/sourceview.js +52 -0
- data/examples/app/sourceview/sourceview.rb +77 -0
- data/examples/app/sourceview/template/index.haml +59 -0
- data/examples/app/todolist/README +1 -0
- data/examples/app/todolist/public/favicon.ico +0 -0
- data/examples/app/todolist/public/js/jquery.js +1923 -0
- data/examples/app/todolist/public/ramaze.png +0 -0
- data/examples/app/todolist/spec/todolist.rb +132 -0
- data/examples/app/todolist/src/controller/main.rb +70 -0
- data/examples/app/todolist/src/element/page.rb +31 -0
- data/examples/app/todolist/src/model.rb +14 -0
- data/examples/app/todolist/start.rb +11 -0
- data/examples/app/todolist/template/index.xhtml +17 -0
- data/examples/app/todolist/template/new.xhtml +7 -0
- data/examples/app/upload/start.rb +19 -0
- data/examples/app/upload/view/index.xhtml +25 -0
- data/examples/app/whywiki/spec/whywiki.rb +58 -0
- data/examples/app/whywiki/start.rb +46 -0
- data/examples/app/whywiki/template/edit.xhtml +14 -0
- data/examples/app/whywiki/template/show.xhtml +18 -0
- data/examples/app/wikore/spec/wikore.rb +111 -0
- data/examples/app/wikore/src/controller.rb +80 -0
- data/examples/app/wikore/src/model.rb +53 -0
- data/examples/app/wikore/start.rb +9 -0
- data/examples/app/wikore/template/index.xhtml +8 -0
- data/examples/app/wiktacular/README +2 -0
- data/examples/app/wiktacular/mkd/link/2007-07-20_19-45-51.mkd +1 -0
- data/examples/app/wiktacular/mkd/link/current.mkd +1 -0
- data/examples/app/wiktacular/mkd/main/2007-07-20_16-31-33.mkd +1 -0
- data/examples/app/wiktacular/mkd/main/2007-07-20_19-21-12.mkd +1 -0
- data/examples/app/wiktacular/mkd/main/2007-07-20_19-23-10.mkd +2 -0
- data/examples/app/wiktacular/mkd/main/2007-07-20_19-45-07.mkd +2 -0
- data/examples/app/wiktacular/mkd/main/current.mkd +2 -0
- data/examples/app/wiktacular/mkd/markdown/current.mkd +3 -0
- data/examples/app/wiktacular/mkd/testing/2007-07-20_16-43-46.mkd +2 -0
- data/examples/app/wiktacular/mkd/testing/2007-07-20_19-43-50.mkd +3 -0
- data/examples/app/wiktacular/mkd/testing/2007-07-21_18-46-01.mkd +11 -0
- data/examples/app/wiktacular/mkd/testing/2007-07-21_18-46-32.mkd +13 -0
- data/examples/app/wiktacular/mkd/testing/2007-07-21_18-47-08.mkd +17 -0
- data/examples/app/wiktacular/mkd/testing/2007-07-21_18-47-54.mkd +17 -0
- data/examples/app/wiktacular/mkd/testing/current.mkd +17 -0
- data/examples/app/wiktacular/public/favicon.ico +0 -0
- data/examples/app/wiktacular/public/screen.css +72 -0
- data/examples/app/wiktacular/spec/wiktacular.rb +157 -0
- data/examples/app/wiktacular/src/controller.rb +55 -0
- data/examples/app/wiktacular/src/model.rb +102 -0
- data/examples/app/wiktacular/start.rb +8 -0
- data/examples/app/wiktacular/template/edit.xhtml +6 -0
- data/examples/app/wiktacular/template/html_layout.xhtml +27 -0
- data/examples/app/wiktacular/template/index.xhtml +9 -0
- data/examples/app/wiktacular/template/new.xhtml +6 -0
- data/examples/basic/element.rb +45 -0
- data/examples/basic/gestalt.rb +27 -0
- data/examples/basic/hello.rb +15 -0
- data/examples/basic/layout.rb +28 -0
- data/examples/basic/linking.rb +29 -0
- data/examples/basic/simple.rb +56 -0
- data/examples/helpers/cache.rb +31 -0
- data/examples/helpers/form_with_sequel.rb +24 -0
- data/examples/helpers/httpdigest.rb +50 -0
- data/examples/helpers/identity.rb +18 -0
- data/examples/helpers/nitro_form.rb +23 -0
- data/examples/helpers/paginate.rb +71 -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/misc/css.rb +37 -0
- data/examples/misc/facebook.rb +159 -0
- data/examples/misc/memleak_detector.rb +32 -0
- data/examples/misc/nagoro_element.rb +43 -0
- data/examples/misc/ramaise.rb +132 -0
- data/examples/misc/rapp.rb +45 -0
- data/examples/misc/sequel_scaffolding.rb +34 -0
- data/examples/misc/simple_auth.rb +35 -0
- data/examples/templates/template/external.amrita +19 -0
- data/examples/templates/template/external.haml +22 -0
- data/examples/templates/template/external.liquid +28 -0
- data/examples/templates/template/external.mab +30 -0
- data/examples/templates/template/external.nag +28 -0
- data/examples/templates/template/external.redcloth +19 -0
- data/examples/templates/template/external.rem +30 -0
- data/examples/templates/template/external.rhtml +28 -0
- data/examples/templates/template/external.tenjin +28 -0
- data/examples/templates/template/external.xsl +57 -0
- data/examples/templates/template/external.zmr +28 -0
- data/examples/templates/template_amrita2.rb +74 -0
- data/examples/templates/template_erubis.rb +53 -0
- data/examples/templates/template_ezamar.rb +50 -0
- data/examples/templates/template_haml.rb +50 -0
- data/examples/templates/template_liquid.rb +65 -0
- data/examples/templates/template_markaby.rb +58 -0
- data/examples/templates/template_nagoro.rb +51 -0
- data/examples/templates/template_redcloth.rb +59 -0
- data/examples/templates/template_remarkably.rb +55 -0
- data/examples/templates/template_tenjin.rb +53 -0
- data/examples/templates/template_xslt.rb +49 -0
- data/lib/proto/controller/init.rb +10 -0
- data/lib/proto/controller/main.rb +20 -0
- data/lib/proto/model/init.rb +4 -0
- data/lib/proto/public/css/ramaze_error.css +90 -0
- data/lib/proto/public/dispatch.fcgi +11 -0
- data/lib/proto/public/favicon.ico +0 -0
- data/lib/proto/public/js/jquery.js +3549 -0
- data/lib/proto/public/ramaze.png +0 -0
- data/lib/proto/spec/main.rb +25 -0
- data/lib/proto/start.rb +8 -0
- data/lib/proto/start.ru +16 -0
- data/lib/proto/view/error.xhtml +64 -0
- data/lib/proto/view/index.xhtml +34 -0
- data/lib/proto/view/page.xhtml +27 -0
- data/lib/ramaze/action/render.rb +191 -0
- data/lib/ramaze/action.rb +153 -0
- data/lib/ramaze/adapter/base.rb +128 -0
- data/lib/ramaze/adapter/cgi.rb +20 -0
- data/lib/ramaze/adapter/ebb.rb +18 -0
- data/lib/ramaze/adapter/evented_mongrel.rb +7 -0
- data/lib/ramaze/adapter/fake.rb +12 -0
- data/lib/ramaze/adapter/fcgi.rb +18 -0
- data/lib/ramaze/adapter/lsws.rb +19 -0
- data/lib/ramaze/adapter/mongrel.rb +21 -0
- data/lib/ramaze/adapter/scgi.rb +18 -0
- data/lib/ramaze/adapter/swiftiplied_mongrel.rb +7 -0
- data/lib/ramaze/adapter/thin.rb +17 -0
- data/lib/ramaze/adapter/webrick.rb +43 -0
- data/lib/ramaze/adapter.rb +97 -0
- data/lib/ramaze/cache/memcached.rb +69 -0
- data/lib/ramaze/cache/memory.rb +6 -0
- data/lib/ramaze/cache/yaml_store.rb +68 -0
- data/lib/ramaze/cache.rb +113 -0
- data/lib/ramaze/contrib/auto_params/get_args.rb +58 -0
- data/lib/ramaze/contrib/auto_params.rb +135 -0
- data/lib/ramaze/contrib/email.rb +84 -0
- data/lib/ramaze/contrib/facebook/facebook.rb +171 -0
- data/lib/ramaze/contrib/facebook.rb +23 -0
- data/lib/ramaze/contrib/file_cache.rb +65 -0
- data/lib/ramaze/contrib/gems.rb +78 -0
- data/lib/ramaze/contrib/gettext/mo.rb +155 -0
- data/lib/ramaze/contrib/gettext/parser.rb +46 -0
- data/lib/ramaze/contrib/gettext/po.rb +109 -0
- data/lib/ramaze/contrib/gettext.rb +113 -0
- data/lib/ramaze/contrib/gzip_filter.rb +69 -0
- data/lib/ramaze/contrib/maruku_uv.rb +59 -0
- data/lib/ramaze/contrib/profiling.rb +36 -0
- data/lib/ramaze/contrib/rest.rb +17 -0
- data/lib/ramaze/contrib/sequel/create_join.rb +25 -0
- data/lib/ramaze/contrib/sequel/fill.rb +12 -0
- data/lib/ramaze/contrib/sequel/form_field.rb +129 -0
- data/lib/ramaze/contrib/sequel/image.rb +198 -0
- data/lib/ramaze/contrib/sequel/relation.rb +82 -0
- data/lib/ramaze/contrib/sequel_cache.rb +92 -0
- data/lib/ramaze/contrib.rb +82 -0
- data/lib/ramaze/controller/error.rb +46 -0
- data/lib/ramaze/controller/main.rb +2 -0
- data/lib/ramaze/controller/resolve.rb +273 -0
- data/lib/ramaze/controller.rb +280 -0
- data/lib/ramaze/current/request.rb +205 -0
- data/lib/ramaze/current/response.rb +39 -0
- data/lib/ramaze/current/session/flash.rb +87 -0
- data/lib/ramaze/current/session/hash.rb +66 -0
- data/lib/ramaze/current/session.rb +181 -0
- data/lib/ramaze/current.rb +110 -0
- data/lib/ramaze/dispatcher/action.rb +48 -0
- data/lib/ramaze/dispatcher/directory.rb +119 -0
- data/lib/ramaze/dispatcher/error.rb +108 -0
- data/lib/ramaze/dispatcher/file.rb +95 -0
- data/lib/ramaze/dispatcher.rb +145 -0
- data/lib/ramaze/error.rb +24 -0
- data/lib/ramaze/gestalt.rb +124 -0
- data/lib/ramaze/helper/aspect.rb +106 -0
- data/lib/ramaze/helper/auth.rb +125 -0
- data/lib/ramaze/helper/cache.rb +140 -0
- data/lib/ramaze/helper/cgi.rb +39 -0
- data/lib/ramaze/helper/flash.rb +59 -0
- data/lib/ramaze/helper/form.rb +281 -0
- data/lib/ramaze/helper/formatting.rb +158 -0
- data/lib/ramaze/helper/gestalt.rb +15 -0
- data/lib/ramaze/helper/gravatar.rb +15 -0
- data/lib/ramaze/helper/httpdigest.rb +59 -0
- data/lib/ramaze/helper/identity.rb +119 -0
- data/lib/ramaze/helper/link.rb +122 -0
- data/lib/ramaze/helper/markaby.rb +31 -0
- data/lib/ramaze/helper/maruku.rb +7 -0
- data/lib/ramaze/helper/nitroform.rb +14 -0
- data/lib/ramaze/helper/pager.rb +366 -0
- data/lib/ramaze/helper/paginate.rb +234 -0
- data/lib/ramaze/helper/partial.rb +105 -0
- data/lib/ramaze/helper/redirect.rb +82 -0
- data/lib/ramaze/helper/rest.rb +43 -0
- data/lib/ramaze/helper/sendfile.rb +16 -0
- data/lib/ramaze/helper/sequel.rb +55 -0
- data/lib/ramaze/helper/simple_captcha.rb +31 -0
- data/lib/ramaze/helper/stack.rb +77 -0
- data/lib/ramaze/helper/tagz.rb +19 -0
- data/lib/ramaze/helper/thread.rb +17 -0
- data/lib/ramaze/helper/ultraviolet.rb +44 -0
- data/lib/ramaze/helper/user.rb +110 -0
- data/lib/ramaze/helper/xhtml.rb +23 -0
- data/lib/ramaze/helper.rb +79 -0
- data/lib/ramaze/log/analogger.rb +40 -0
- data/lib/ramaze/log/growl.rb +38 -0
- data/lib/ramaze/log/hub.rb +41 -0
- data/lib/ramaze/log/informer.rb +128 -0
- data/lib/ramaze/log/knotify.rb +28 -0
- data/lib/ramaze/log/logger.rb +26 -0
- data/lib/ramaze/log/logging.rb +89 -0
- data/lib/ramaze/log/syslog.rb +51 -0
- data/lib/ramaze/log/xosd.rb +92 -0
- data/lib/ramaze/log.rb +27 -0
- data/lib/ramaze/option/dsl.rb +45 -0
- data/lib/ramaze/option/holder.rb +131 -0
- data/lib/ramaze/option/merger.rb +108 -0
- data/lib/ramaze/option.rb +156 -0
- data/lib/ramaze/reloader.rb +186 -0
- data/lib/ramaze/route.rb +97 -0
- data/lib/ramaze/setup.rb +50 -0
- data/lib/ramaze/snippets/array/put_within.rb +44 -0
- data/lib/ramaze/snippets/binding/locals.rb +25 -0
- data/lib/ramaze/snippets/blankslate.rb +7 -0
- data/lib/ramaze/snippets/dictionary.rb +504 -0
- data/lib/ramaze/snippets/divide.rb +20 -0
- data/lib/ramaze/snippets/fiber.rb +63 -0
- data/lib/ramaze/snippets/kernel/constant.rb +41 -0
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +21 -0
- data/lib/ramaze/snippets/metaid.rb +17 -0
- data/lib/ramaze/snippets/numeric/filesize_format.rb +32 -0
- data/lib/ramaze/snippets/numeric/time.rb +63 -0
- data/lib/ramaze/snippets/object/__dir__.rb +29 -0
- data/lib/ramaze/snippets/object/acquire.rb +40 -0
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +19 -0
- data/lib/ramaze/snippets/object/pretty.rb +16 -0
- data/lib/ramaze/snippets/object/scope.rb +18 -0
- data/lib/ramaze/snippets/object/traits.rb +76 -0
- data/lib/ramaze/snippets/ordered_set.rb +51 -0
- data/lib/ramaze/snippets/proc/locals.rb +19 -0
- data/lib/ramaze/snippets/ramaze/caller_info.rb +30 -0
- data/lib/ramaze/snippets/ramaze/caller_lines.rb +51 -0
- data/lib/ramaze/snippets/ramaze/deprecated.rb +20 -0
- data/lib/ramaze/snippets/ramaze/fiber.rb +24 -0
- data/lib/ramaze/snippets/ramaze/state.rb +86 -0
- data/lib/ramaze/snippets/ramaze/struct.rb +45 -0
- data/lib/ramaze/snippets/string/camel_case.rb +21 -0
- data/lib/ramaze/snippets/string/color.rb +31 -0
- data/lib/ramaze/snippets/string/each.rb +19 -0
- data/lib/ramaze/snippets/string/end_with.rb +20 -0
- data/lib/ramaze/snippets/string/esc.rb +34 -0
- data/lib/ramaze/snippets/string/ord.rb +21 -0
- data/lib/ramaze/snippets/string/snake_case.rb +21 -0
- data/lib/ramaze/snippets/string/start_with.rb +19 -0
- data/lib/ramaze/snippets/string/unindent.rb +28 -0
- data/lib/ramaze/snippets/thread/into.rb +18 -0
- data/lib/ramaze/snippets.rb +22 -0
- data/lib/ramaze/spec/helper/bacon.rb +7 -0
- data/lib/ramaze/spec/helper/browser.rb +88 -0
- data/lib/ramaze/spec/helper/mock_http.rb +63 -0
- data/lib/ramaze/spec/helper/pretty_output.rb +82 -0
- data/lib/ramaze/spec/helper/requester.rb +63 -0
- data/lib/ramaze/spec/helper/simple_http.rb +434 -0
- data/lib/ramaze/spec/helper/snippets.rb +14 -0
- data/lib/ramaze/spec/helper.rb +135 -0
- data/lib/ramaze/spec.rb +1 -0
- data/lib/ramaze/store/default.rb +109 -0
- data/lib/ramaze/template/amrita2.rb +45 -0
- data/lib/ramaze/template/builder.rb +28 -0
- data/lib/ramaze/template/erubis.rb +41 -0
- data/lib/ramaze/template/ezamar/element.rb +169 -0
- data/lib/ramaze/template/ezamar/engine.rb +76 -0
- data/lib/ramaze/template/ezamar/morpher.rb +135 -0
- data/lib/ramaze/template/ezamar/render_partial.rb +31 -0
- data/lib/ramaze/template/ezamar/textpow.syntax +34 -0
- data/lib/ramaze/template/ezamar.rb +42 -0
- data/lib/ramaze/template/haml.rb +37 -0
- data/lib/ramaze/template/liquid.rb +36 -0
- data/lib/ramaze/template/markaby.rb +52 -0
- data/lib/ramaze/template/maruku.rb +34 -0
- data/lib/ramaze/template/nagoro.rb +52 -0
- data/lib/ramaze/template/none.rb +14 -0
- data/lib/ramaze/template/redcloth.rb +25 -0
- data/lib/ramaze/template/remarkably.rb +38 -0
- data/lib/ramaze/template/sass.rb +37 -0
- data/lib/ramaze/template/tagz.rb +79 -0
- data/lib/ramaze/template/tenjin.rb +74 -0
- data/lib/ramaze/template/xslt.rb +100 -0
- data/lib/ramaze/template.rb +87 -0
- data/lib/ramaze/tool/create.rb +48 -0
- data/lib/ramaze/tool/daemonize.rb +37 -0
- data/lib/ramaze/tool/localize.rb +202 -0
- data/lib/ramaze/tool/mime.rb +35 -0
- data/lib/ramaze/tool/mime_types.yaml +615 -0
- data/lib/ramaze/tool/project_creator.rb +110 -0
- data/lib/ramaze/tool/record.rb +6 -0
- data/lib/ramaze/tool.rb +9 -0
- data/lib/ramaze/trinity.rb +16 -0
- data/lib/ramaze/version.rb +6 -0
- data/lib/ramaze.rb +133 -0
- data/lib/vendor/bacon.rb +323 -0
- data/rake_tasks/conf.rake +71 -0
- data/rake_tasks/coverage.rake +46 -0
- data/rake_tasks/gem.rake +74 -0
- data/rake_tasks/git.rake +41 -0
- data/rake_tasks/maintenance.rake +386 -0
- data/rake_tasks/metric.rake +24 -0
- data/rake_tasks/release.rake +76 -0
- data/rake_tasks/spec.rake +61 -0
- data/ramaze.gemspec +773 -0
- data/spec/contrib/auto_params.rb +121 -0
- data/spec/contrib/profiling.rb +29 -0
- data/spec/contrib/sequel/fill.rb +47 -0
- data/spec/examples/caching.rb +19 -0
- data/spec/examples/css.rb +15 -0
- data/spec/examples/element.rb +15 -0
- data/spec/examples/hello.rb +11 -0
- data/spec/examples/linking.rb +18 -0
- data/spec/examples/simple.rb +45 -0
- data/spec/examples/simple_auth.rb +32 -0
- data/spec/examples/templates/template_amrita2.rb +16 -0
- data/spec/examples/templates/template_erubis.rb +23 -0
- data/spec/examples/templates/template_ezamar.rb +23 -0
- data/spec/examples/templates/template_haml.rb +23 -0
- data/spec/examples/templates/template_liquid.rb +29 -0
- data/spec/examples/templates/template_markaby.rb +23 -0
- data/spec/examples/templates/template_redcloth.rb +28 -0
- data/spec/examples/templates/template_remarkably.rb +23 -0
- data/spec/examples/templates/template_tenjin.rb +28 -0
- data/spec/helper.rb +3 -0
- data/spec/ramaze/action/basics.rb +36 -0
- data/spec/ramaze/action/cache.rb +87 -0
- data/spec/ramaze/action/file_cache.rb +70 -0
- data/spec/ramaze/action/layout.rb +190 -0
- data/spec/ramaze/action/render.rb +31 -0
- data/spec/ramaze/action/view/bar.xhtml +1 -0
- data/spec/ramaze/action/view/instancevars/layout.xhtml +1 -0
- data/spec/ramaze/action/view/other_wrapper.xhtml +1 -0
- data/spec/ramaze/action/view/single_wrapper.xhtml +1 -0
- data/spec/ramaze/action/view/sub/sub_wrapper.xhtml +1 -0
- data/spec/ramaze/adapter/ebb.rb +12 -0
- data/spec/ramaze/adapter/mongrel.rb +12 -0
- data/spec/ramaze/adapter/record.rb +31 -0
- data/spec/ramaze/adapter/webrick.rb +12 -0
- data/spec/ramaze/adapter.rb +49 -0
- data/spec/ramaze/cache.rb +140 -0
- data/spec/ramaze/controller/actionless_templates.rb +32 -0
- data/spec/ramaze/controller/resolve.rb +32 -0
- data/spec/ramaze/controller/subclass.rb +36 -0
- data/spec/ramaze/controller/template_resolving.rb +113 -0
- data/spec/ramaze/controller/view/bar.xhtml +1 -0
- data/spec/ramaze/controller/view/base/another.xhtml +1 -0
- data/spec/ramaze/controller/view/greet.xhtml +1 -0
- data/spec/ramaze/controller/view/list.xhtml +1 -0
- data/spec/ramaze/controller/view/other/greet/other.xhtml +1 -0
- data/spec/ramaze/controller/view/other_wrapper.xhtml +1 -0
- data/spec/ramaze/controller.rb +180 -0
- data/spec/ramaze/current/request.rb +30 -0
- data/spec/ramaze/current/session.rb +97 -0
- data/spec/ramaze/dispatcher/directory.rb +55 -0
- data/spec/ramaze/dispatcher/file.rb +60 -0
- data/spec/ramaze/dispatcher/public/favicon.ico +0 -0
- data/spec/ramaze/dispatcher/public/file name.txt +1 -0
- data/spec/ramaze/dispatcher/public/test_download.css +141 -0
- data/spec/ramaze/dispatcher.rb +31 -0
- data/spec/ramaze/element.rb +107 -0
- data/spec/ramaze/error.rb +94 -0
- data/spec/ramaze/gestalt.rb +131 -0
- data/spec/ramaze/helper/aspect.rb +101 -0
- data/spec/ramaze/helper/auth.rb +66 -0
- data/spec/ramaze/helper/cache.rb +160 -0
- data/spec/ramaze/helper/cgi.rb +43 -0
- data/spec/ramaze/helper/file.rb +18 -0
- data/spec/ramaze/helper/flash.rb +133 -0
- data/spec/ramaze/helper/form.rb +118 -0
- data/spec/ramaze/helper/formatting.rb +54 -0
- data/spec/ramaze/helper/link.rb +124 -0
- data/spec/ramaze/helper/pager.rb +99 -0
- data/spec/ramaze/helper/partial.rb +88 -0
- data/spec/ramaze/helper/redirect.rb +112 -0
- data/spec/ramaze/helper/simple_captcha.rb +22 -0
- data/spec/ramaze/helper/stack.rb +73 -0
- data/spec/ramaze/helper/user.rb +43 -0
- data/spec/ramaze/helper/view/locals.xhtml +1 -0
- data/spec/ramaze/helper/view/loop.xhtml +4 -0
- data/spec/ramaze/helper/view/num.xhtml +1 -0
- data/spec/ramaze/helper/view/partial.xhtml +1 -0
- data/spec/ramaze/helper/view/recursive.xhtml +8 -0
- data/spec/ramaze/helper/view/recursive_local_ivars.xhtml +7 -0
- data/spec/ramaze/helper/view/recursive_locals.xhtml +7 -0
- data/spec/ramaze/helper/view/test_template.xhtml +1 -0
- data/spec/ramaze/localize.rb +89 -0
- data/spec/ramaze/log/informer.rb +72 -0
- data/spec/ramaze/log/syslog.rb +73 -0
- data/spec/ramaze/morpher.rb +111 -0
- data/spec/ramaze/params.rb +157 -0
- data/spec/ramaze/public/error404.xhtml +1 -0
- data/spec/ramaze/public/favicon.ico +0 -0
- data/spec/ramaze/public/ramaze.png +0 -0
- data/spec/ramaze/public/test_download.css +141 -0
- data/spec/ramaze/request/ebb.rb +9 -0
- data/spec/ramaze/request/mongrel.rb +9 -0
- data/spec/ramaze/request/thin.rb +9 -0
- data/spec/ramaze/request/webrick.rb +5 -0
- data/spec/ramaze/request.rb +185 -0
- data/spec/ramaze/rewrite/file.css +1 -0
- data/spec/ramaze/rewrite.rb +36 -0
- data/spec/ramaze/route.rb +131 -0
- data/spec/ramaze/session.rb +94 -0
- data/spec/ramaze/store/default.rb +71 -0
- data/spec/ramaze/struct.rb +47 -0
- data/spec/ramaze/template/amrita2/external.amrita +6 -0
- data/spec/ramaze/template/amrita2/sum.amrita +1 -0
- data/spec/ramaze/template/amrita2.rb +50 -0
- data/spec/ramaze/template/builder/external.rxml +3 -0
- data/spec/ramaze/template/builder.rb +51 -0
- data/spec/ramaze/template/erubis/sum.rhtml +1 -0
- data/spec/ramaze/template/erubis.rb +41 -0
- data/spec/ramaze/template/ezamar/another/long/action.zmr +1 -0
- data/spec/ramaze/template/ezamar/combined.zmr +1 -0
- data/spec/ramaze/template/ezamar/file_only.zmr +1 -0
- data/spec/ramaze/template/ezamar/index.zmr +1 -0
- data/spec/ramaze/template/ezamar/nested.zmr +1 -0
- data/spec/ramaze/template/ezamar/other__index.xhtml +1 -0
- data/spec/ramaze/template/ezamar/some__long__action.zmr +1 -0
- data/spec/ramaze/template/ezamar/sum.zmr +1 -0
- data/spec/ramaze/template/ezamar.rb +63 -0
- data/spec/ramaze/template/haml/index.haml +5 -0
- data/spec/ramaze/template/haml/locals.haml +2 -0
- data/spec/ramaze/template/haml/with_vars.haml +4 -0
- data/spec/ramaze/template/haml.rb +66 -0
- data/spec/ramaze/template/liquid/index.liquid +1 -0
- data/spec/ramaze/template/liquid/products.liquid +45 -0
- data/spec/ramaze/template/liquid.rb +99 -0
- data/spec/ramaze/template/markaby/external.mab +8 -0
- data/spec/ramaze/template/markaby/sum.mab +1 -0
- data/spec/ramaze/template/markaby.rb +61 -0
- data/spec/ramaze/template/nagoro/another/long/action.nag +1 -0
- data/spec/ramaze/template/nagoro/combined.nag +1 -0
- data/spec/ramaze/template/nagoro/file_only.nag +1 -0
- data/spec/ramaze/template/nagoro/index.nag +1 -0
- data/spec/ramaze/template/nagoro/nested.nag +1 -0
- data/spec/ramaze/template/nagoro/some__long__action.nag +1 -0
- data/spec/ramaze/template/nagoro/sum.nag +1 -0
- data/spec/ramaze/template/nagoro.rb +64 -0
- data/spec/ramaze/template/ramaze/external.test +1 -0
- data/spec/ramaze/template/redcloth/external.redcloth +1 -0
- data/spec/ramaze/template/redcloth.rb +38 -0
- data/spec/ramaze/template/remarkably/external.rem +8 -0
- data/spec/ramaze/template/remarkably/sum.rem +1 -0
- data/spec/ramaze/template/remarkably.rb +58 -0
- data/spec/ramaze/template/sass/file.css.sass +5 -0
- data/spec/ramaze/template/sass.rb +69 -0
- data/spec/ramaze/template/tagz/external.tagz +8 -0
- data/spec/ramaze/template/tagz/sum.tagz +1 -0
- data/spec/ramaze/template/tagz.rb +62 -0
- data/spec/ramaze/template/tenjin/external.tenjin +1 -0
- data/spec/ramaze/template/tenjin.rb +47 -0
- data/spec/ramaze/template/xslt/concat_words.xsl +16 -0
- data/spec/ramaze/template/xslt/index.xsl +14 -0
- data/spec/ramaze/template/xslt/products.xsl +32 -0
- data/spec/ramaze/template/xslt/ruby_version.xsl +14 -0
- data/spec/ramaze/template/xslt.rb +90 -0
- data/spec/ramaze/template.rb +128 -0
- data/spec/snippets/array/put_within.rb +33 -0
- data/spec/snippets/binding/locals.rb +9 -0
- data/spec/snippets/divide.rb +19 -0
- data/spec/snippets/kernel/constant.rb +23 -0
- data/spec/snippets/numeric/filesize_format.rb +12 -0
- data/spec/snippets/numeric/time.rb +12 -0
- data/spec/snippets/object/__dir__.rb +8 -0
- data/spec/snippets/object/acquire.rb +71 -0
- data/spec/snippets/ordered_set.rb +63 -0
- data/spec/snippets/ramaze/caller_info.rb +39 -0
- data/spec/snippets/ramaze/caller_lines.rb +30 -0
- data/spec/snippets/string/camel_case.rb +25 -0
- data/spec/snippets/string/color.rb +11 -0
- data/spec/snippets/string/snake_case.rb +24 -0
- data/spec/snippets/string/unindent.rb +43 -0
- data/spec/snippets/thread/into.rb +20 -0
- metadata +823 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
This time we are proud to announce Version 2008.07 of Ramaze, the light and
|
2
|
+
modular open source web framework.
|
3
|
+
|
4
|
+
This release features a lot of work directly from our community and we are
|
5
|
+
really greatful for everybody who helped in testing, patching and contributing
|
6
|
+
exciting new features.
|
7
|
+
|
8
|
+
Our extensive set of specs and docs now covers almost every detail of
|
9
|
+
implementation and usage. Ramaze is under development by a growing community
|
10
|
+
and in production use at companies.
|
11
|
+
|
12
|
+
|
13
|
+
Home page: http://ramaze.net
|
14
|
+
Screencasts: http://ramaze.net/screencasts
|
15
|
+
|
16
|
+
Source browser: http://source.ramaze.net
|
17
|
+
Repository: http://github.com/manveru/ramaze
|
18
|
+
|
19
|
+
Nightly gems: http://gems.ramaze.net
|
20
|
+
Git clone: git://github.com/manveru/ramaze
|
21
|
+
Current tarball: http://github.com/manveru/ramaze/tarball/master
|
22
|
+
|
23
|
+
IRC: #ramaze on irc.freenode.net
|
24
|
+
|
25
|
+
|
26
|
+
Simple example:
|
27
|
+
|
28
|
+
require 'ramaze'
|
29
|
+
|
30
|
+
class MainController
|
31
|
+
def index
|
32
|
+
'Hello, World!'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
Ramaze.start
|
37
|
+
|
38
|
+
|
39
|
+
Some of 52 patches since 2008.06:
|
40
|
+
|
41
|
+
- Loggers are now in Ramaze::Logger namespace
|
42
|
+
- Global.prefix for nested deployment via webserver in front
|
43
|
+
- Binding#locals fixed for Ruby 1.9
|
44
|
+
- Redirects now use HTTP status 302 instead of 303
|
45
|
+
- Logger::Syslog works again
|
46
|
+
|
47
|
+
Special (alphabetic) thanks go to:
|
48
|
+
|
49
|
+
Pistos - The usual Mathetes, patches and lots of friendly support
|
50
|
+
Aman 'tmm1' Gupta - Time snippets for numeric
|
51
|
+
Clinton R. Nixon - More REST and some fixes
|
52
|
+
Jean-Francois Chevrette - Restore --console feature
|
53
|
+
raggi - Various fixes
|
54
|
+
Rob Lievaart - Fix Logger::Syslog
|
55
|
+
Sam Carr - Cleanup of Cache
|
56
|
+
Wang Jinjing - 1.9 compatibility
|
57
|
+
Yasushi Abe - First patch!
|
58
|
+
|
59
|
+
A complete Changelog is available at
|
60
|
+
http://github.com/manveru/ramaze/tree/master/doc/CHANGELOG?raw=true
|
61
|
+
|
62
|
+
|
63
|
+
Known issues:
|
64
|
+
|
65
|
+
- none yet, waiting for your reports :)
|
66
|
+
|
67
|
+
|
68
|
+
Ramaze Features:
|
69
|
+
- Builds on top of the Rack library, which provides easy use of adapters like
|
70
|
+
Mongrel, WEBrick, LiteSpeed, Thin, CGI or FCGI.
|
71
|
+
|
72
|
+
- Supports a wide range of templating-engines like: Amrita2, Erubis, Haml,
|
73
|
+
Liquid, Markaby, Remarkably and its own engine called Ezamar and (still
|
74
|
+
unofficial) Nagoro.
|
75
|
+
|
76
|
+
- Highly modular structure: you can just use the parts you like. This also
|
77
|
+
means that it's very simple to add your own customizations.
|
78
|
+
|
79
|
+
- A variety of helpers is already available, giving you things like advanced
|
80
|
+
caching, OpenID-authentication or aspect-oriented programming for your
|
81
|
+
controllers.
|
82
|
+
|
83
|
+
- It is possible to use the ORM you like, be it Sequel, DataMapper,
|
84
|
+
ActiveRecord, Og, Kansas or something more simplistic like DBI, or a
|
85
|
+
wrapper around YAML::Store.
|
86
|
+
|
87
|
+
- Good documentation: although we don't have 100% documentation right now
|
88
|
+
(dcov says around 75%), just about every part of Ramaze is covered with
|
89
|
+
basic and advanced docs. There are a variety of examples, screencasts and a
|
90
|
+
tutorial available.
|
91
|
+
|
92
|
+
- Friendly community: there are people from all over the world using Ramaze,
|
93
|
+
so you can get almost instant help and info.
|
94
|
+
|
95
|
+
|
96
|
+
For more information please come to http://ramaze.net or ask directly on IRC
|
97
|
+
irc://irc.freenode.net/#ramaze
|
98
|
+
|
99
|
+
Thank you, Michael 'manveru' Fellinger and the Ramaze community
|
@@ -0,0 +1,163 @@
|
|
1
|
+
This chapter covers how to do configuration in Ramaze for your application.
|
2
|
+
|
3
|
+
|
4
|
+
### Global
|
5
|
+
|
6
|
+
The object holding most configuration is called Global. It resides in the Ramaze
|
7
|
+
module/name space.
|
8
|
+
|
9
|
+
Global is an instance of GlobalStruct, which itself is an instance of Struct.
|
10
|
+
There have been some changes to it to suit its purpose.
|
11
|
+
|
12
|
+
Before covering some of the available options let us see how to actually use it.
|
13
|
+
|
14
|
+
For the examples shown here we will assume that you did include Ramaze
|
15
|
+
into your main into your main name space. If you don't do that, just prefix
|
16
|
+
Global with Ramaze so it is written Ramaze::Global.
|
17
|
+
|
18
|
+
|
19
|
+
#### Basic assignment:
|
20
|
+
|
21
|
+
Global.port = 10
|
22
|
+
|
23
|
+
if you do that before calling Ramaze::start Ramaze will choose the given number
|
24
|
+
as port.
|
25
|
+
|
26
|
+
|
27
|
+
#### Multiple assignment:
|
28
|
+
|
29
|
+
Global.setup :adapter => :mongrel,
|
30
|
+
:cache => :memcached
|
31
|
+
|
32
|
+
So you can pass a Hash of all the options you want to change.
|
33
|
+
In this case you would use Mongrel as the adapter and use memcached for your
|
34
|
+
sessions and general caching.
|
35
|
+
|
36
|
+
|
37
|
+
#### Block assignment:
|
38
|
+
|
39
|
+
Global.setup do |g|
|
40
|
+
g.error_page = false
|
41
|
+
g.host = '127.0.0.1'
|
42
|
+
g.port = 7070
|
43
|
+
end
|
44
|
+
|
45
|
+
This method is similar to the hash-assignment, but may be preferred for some
|
46
|
+
applications.
|
47
|
+
|
48
|
+
|
49
|
+
#### Pass on Ramaze.start
|
50
|
+
|
51
|
+
Ramaze.start :run_loose => true
|
52
|
+
|
53
|
+
This way you can save a line or two in a small script.
|
54
|
+
Please note that the values passed here have precedence over the ones directly
|
55
|
+
set on Global and will overwrite them if you set them before, that is mostly
|
56
|
+
useful to quickly test some configuration.
|
57
|
+
|
58
|
+
|
59
|
+
### Global options
|
60
|
+
|
61
|
+
This listing is here to provide you with descriptions of the most common
|
62
|
+
configurations in alphabetical order per section showing the default value next
|
63
|
+
to the key.
|
64
|
+
|
65
|
+
This chapter has been shrunk a lot to cover only essentials, please look at
|
66
|
+
lib/ramaze/global.rb to see all available options.
|
67
|
+
|
68
|
+
Date of last update: 2007-05-20
|
69
|
+
|
70
|
+
#### General Configuration:
|
71
|
+
|
72
|
+
:sourcereload => 3
|
73
|
+
|
74
|
+
SourceReload is a nifty mechanism that takes advantage of the dynamics of Ruby,
|
75
|
+
it's basically a Thread that runs in the background and polls for files in the
|
76
|
+
application and framework that have changed (using mtime). The value specifies
|
77
|
+
roughly how fast your changes are going to be loaded and should be a number.
|
78
|
+
If you set this to false, it will not start.
|
79
|
+
|
80
|
+
|
81
|
+
:adapter => :webrick
|
82
|
+
|
83
|
+
The adapter is the server Ramaze runs to serve your application. This can be any
|
84
|
+
of mongrel/webrick/fcgi/cgi, please note that so far neither fcgi nor cgi have
|
85
|
+
received the necessary testing, but, as they are only wrappers around the
|
86
|
+
underlying Rack library, should work fine. Both fcgi and mongrel require
|
87
|
+
additional libraries to be installed, webrick and cgi run out of the box.
|
88
|
+
Generally the most supported and recommended for deployment is Mongrel.
|
89
|
+
|
90
|
+
|
91
|
+
:cache => :memory
|
92
|
+
|
93
|
+
Possible: :memory, :memcached, :yaml
|
94
|
+
The cache is one of the more important things for deployment, the default for
|
95
|
+
this is MemoryCache, a simple Hash.
|
96
|
+
What you specify here will be used by Ramaze::Cache and is used throughout
|
97
|
+
Ramaze to cache various things, like sessions, page- and value-caching.
|
98
|
+
Included in Ramaze are the MemoryCache and YAMLStoreCache, after you install
|
99
|
+
'memcached' you can also use the much more performant MemcachedCache that also
|
100
|
+
makes it easy to use the same cache between different applications (sharing
|
101
|
+
sessions is one of the most obvious uses).
|
102
|
+
|
103
|
+
|
104
|
+
:cache_all => false
|
105
|
+
|
106
|
+
Setting this value to true would enable caching for all pages served from the
|
107
|
+
Controller (all actions).
|
108
|
+
This is a very powerful setting and you might want to enable it if all pages
|
109
|
+
you serve are only built once and have no further dynamics, the key for this
|
110
|
+
cache consists of the controller and parameters, when repeated requests are
|
111
|
+
made it will always serve the same (now static) page.
|
112
|
+
|
113
|
+
|
114
|
+
:sessions => true
|
115
|
+
|
116
|
+
Enables creation of sessions and automatic creation/setting of cookies.
|
117
|
+
Please note that many functionalities of Ramaze depend on an intact session and
|
118
|
+
you will have to be careful not to use these.
|
119
|
+
This is most likely useful in combination with `cache_all`
|
120
|
+
|
121
|
+
|
122
|
+
:error_page => true
|
123
|
+
|
124
|
+
Enables the default Error page of Ramaze which is mostly useful for manual
|
125
|
+
testing and faster debugging. In most deployment-scenarios you will however
|
126
|
+
want to use your own Error page and so you can safely disable this setting.
|
127
|
+
|
128
|
+
:host => '0.0.0.0'
|
129
|
+
|
130
|
+
Tell the adapter where it accepts requests from, 0.0.0.0 says that every
|
131
|
+
IP will be accepted, 127.0.0.1 would accept only requests from loopback.
|
132
|
+
|
133
|
+
|
134
|
+
:mapping => {}
|
135
|
+
|
136
|
+
This is a very central and special setting, it contains key/value pairs
|
137
|
+
that define routes to your controllers, the keys are simple strings and
|
138
|
+
start with '/', which means http://yourhost.com/ - '/foo/bar' would point
|
139
|
+
to http://yourhost.com/foo/bar.
|
140
|
+
The value is the class of your controller.
|
141
|
+
|
142
|
+
|
143
|
+
:port => 7000
|
144
|
+
|
145
|
+
The port Ramaze runs on, if you can think of more information about this feel
|
146
|
+
free to tell us.
|
147
|
+
|
148
|
+
|
149
|
+
:run_loose => false
|
150
|
+
|
151
|
+
This option is mostly used to run the specs, it means that Ramaze will not
|
152
|
+
join the adapter-threads and therefor you are free to run any code you want
|
153
|
+
afterwards. You won't have to use this in most cases, example usage is in
|
154
|
+
spec/spec_helper.
|
155
|
+
|
156
|
+
|
157
|
+
:template_root => 'template'
|
158
|
+
|
159
|
+
The template_root is the point your templates are located relative to the
|
160
|
+
location of the entry-file (usually start.rb)
|
161
|
+
It is also worth to mention that inside this directory the `mapping` is used
|
162
|
+
to locate templates for each controller, only the controller mapped to '/' uses
|
163
|
+
the templates directly from the `template_root`
|
@@ -0,0 +1,278 @@
|
|
1
|
+
This document is a humble attempt to explain the internal workings of Ramaze and
|
2
|
+
how the different parts fit into the big picture.
|
3
|
+
|
4
|
+
It does not try to describe every little detail, as you will be better off
|
5
|
+
reading the actual source instead. But you will at least get an idea of where to
|
6
|
+
look.
|
7
|
+
|
8
|
+
### Ramaze
|
9
|
+
|
10
|
+
Ramaze is a web framework and therefor tries to make it simple to deploy your
|
11
|
+
own applications on top of it.
|
12
|
+
Let's outline the realms that Ramaze works in as to show what the current
|
13
|
+
limitations and features are.
|
14
|
+
|
15
|
+
|
16
|
+
#### Life of a request/response cycle
|
17
|
+
|
18
|
+
This is a small summary of how a request creates a response in the
|
19
|
+
examples/hello.rb and webrick (to keep it simple and short).
|
20
|
+
All files referenced here are in lib/ramaze/ unless indicated otherwise.
|
21
|
+
We don't explain the startup/shutdown process, only what happens from request to
|
22
|
+
the eventual response.
|
23
|
+
|
24
|
+
Browser sends request, webrick receives it and hands the ENV over to our rack
|
25
|
+
handler (adapter/webrick.rb and adapter/base.rb).
|
26
|
+
There it gets converted into a Ramaze::Request (trinity/request.rb) and
|
27
|
+
a new blank Ramaze::Response (trinity/response.rb) is created.
|
28
|
+
These two objects are then sent to Dispatcher::handle (dispatcher.rb).
|
29
|
+
|
30
|
+
This all happens inside a new Thread, which is what Ramaze takes advantage of by
|
31
|
+
assigning Thread-variables. You can see this now in
|
32
|
+
Dispatcher::setup_environment which sets :request/:session/:response in
|
33
|
+
Thread.current.
|
34
|
+
|
35
|
+
After that, Dispatcher::dispatch is called with the path from request.path_info
|
36
|
+
which in turn takes every class/module set in Dispatcher::FILTER and calls
|
37
|
+
::process with the path.
|
38
|
+
|
39
|
+
|
40
|
+
##### First, `/favicon.ico` (for most browsers)
|
41
|
+
|
42
|
+
The first in FILTER is Dispatcher::File (dispatcher/file.rb) which searches
|
43
|
+
Global.public_root and afterwards Global.public_proto for a matching file on
|
44
|
+
this path. In our example the file found is a favicon.ico from
|
45
|
+
Global.public_proto.
|
46
|
+
|
47
|
+
The contents of FILTER have to return a Ramaze::Response, either the (possibly
|
48
|
+
modified) original (Response#build helps with that) or a totally new
|
49
|
+
one.
|
50
|
+
|
51
|
+
In our case, Dispatcher::File uses response#build with an opened filehandler as
|
52
|
+
body, '200 OK' as status and the Content-Type set to what Tool::MIME.type_for
|
53
|
+
tells it is the correct mimetype for this file.
|
54
|
+
|
55
|
+
|
56
|
+
##### Second, `/hello`
|
57
|
+
|
58
|
+
We start in the processing of FILTER, since the previous steps are the same for
|
59
|
+
every request.
|
60
|
+
|
61
|
+
Here we now get only a nil value back from Dispatcher::File since no file in our
|
62
|
+
two public directories exists for the given path.
|
63
|
+
|
64
|
+
So, this time, Dispatcher::Action is called via ::process and the first thing
|
65
|
+
this dispatcher does is trying to set the body of the request to the answer of
|
66
|
+
Controller.handle (controller.rb) for the given path.
|
67
|
+
|
68
|
+
Controller::handle doesn't do much either, but calls Controller::resolve
|
69
|
+
(controller/resolve.rb) for the path.
|
70
|
+
|
71
|
+
Here we get now into the guts of Ramaze, despite our efforts it's no easy
|
72
|
+
reading since the underlying theory is a bit complex and many edge-cases have to
|
73
|
+
be solved.
|
74
|
+
|
75
|
+
Let me try to quickly sketch what happens here, maybe we can add a chapter about
|
76
|
+
this aspect of Ramaze later.
|
77
|
+
|
78
|
+
First we generate a pattern of how the requested path could fit into our
|
79
|
+
controller and template structure. `/hello` only has 3 possible outcomes:
|
80
|
+
|
81
|
+
Controller on '/', template or method `hello`
|
82
|
+
Controller on '/', method `index` with parameter `hello`
|
83
|
+
Controller on '/hello', method or template `index`
|
84
|
+
|
85
|
+
After matching (in the order we wrote here) these possibilities against your
|
86
|
+
application we get only one possibility, MainController on '/' with method
|
87
|
+
`index`.
|
88
|
+
|
89
|
+
The result is stored into an instance of Action and cached for repeated lookups,
|
90
|
+
then passed back into Dispatcher::handle which subsequently calls Action#render
|
91
|
+
(action/render.rb) on it.
|
92
|
+
|
93
|
+
From here, Thread.current[:action] gets set and #uncached_render is called. This
|
94
|
+
calls #before_process which only has effects if you have the AspectHelper
|
95
|
+
activated and next on comes engine.transform with self as parameter.
|
96
|
+
#engine is a method that figures out which engine this Action has to be rendered
|
97
|
+
with, according to things like trait[:engine] in your controller and the
|
98
|
+
extension of a template. In this case we have neither and the default engine
|
99
|
+
Template::Ezamar (template/ezamar.rb) is used.
|
100
|
+
|
101
|
+
So off we go, to Template::Ezamar::transform with the current instance of Action
|
102
|
+
as parameter.
|
103
|
+
|
104
|
+
::transform first calls ::wrap_compile which is inherited from Template
|
105
|
+
(template.rb) and manages caching of compiled templates, calling ::compile with
|
106
|
+
the action and template.
|
107
|
+
|
108
|
+
The template again is retrieved through two attempts, firstly, we always call
|
109
|
+
the method (if specified from Controller::resolve) on the controller, we
|
110
|
+
temporarily store its result and replace it if a path for a template is set with
|
111
|
+
the contents of the file on this path. The result of this is the final template
|
112
|
+
that is ready for compilation.
|
113
|
+
|
114
|
+
In the case of Ezamar, we first walk the TRANSFORM_PIPELINE (only
|
115
|
+
Ezamar::Element (template/ezamar/element.rb) with ::transform and pass each the
|
116
|
+
template for manipulation. In the example we don't have any elements, so we get
|
117
|
+
back what we gave and generate a new instance of Ezamar::Template
|
118
|
+
(template/ezamar/engine.rb) with the template and a path that indicates eval
|
119
|
+
where we currently are supposed to be (templates path or the transformer).
|
120
|
+
|
121
|
+
This instance is passed back to Ezamar::transform and we call #result with the
|
122
|
+
actions binding (retrieved from earlier instantiation of the controller and
|
123
|
+
subsequently eval `binding` inside of it).
|
124
|
+
|
125
|
+
Now it's all done, we have got our body for the response which will be sent back
|
126
|
+
to our handler as body.
|
127
|
+
|
128
|
+
|
129
|
+
#### The Ramaze module
|
130
|
+
|
131
|
+
Ramaze is also the main module or so-called namespace that the framework lives
|
132
|
+
in. It has
|
133
|
+
|
134
|
+
Tasks on require
|
135
|
+
|
136
|
+
* Inform
|
137
|
+
* LogHub.new(Informer)
|
138
|
+
* Global
|
139
|
+
* GlobalStruct.new
|
140
|
+
|
141
|
+
|
142
|
+
Tasks on startup as defined in Ramaze.trait[:internals] in lib/ramaze.rb
|
143
|
+
|
144
|
+
* Global::startup
|
145
|
+
* passed options to Ramaze.start
|
146
|
+
* CLI options from bin/ramaze (treat as passed.merge)
|
147
|
+
* Global options set before startup (fake Global?)
|
148
|
+
|
149
|
+
* Cache::startup
|
150
|
+
* adds the following caches via Cache.add:
|
151
|
+
* compiled
|
152
|
+
If Global.compile is set true this cache is used to store the compiled
|
153
|
+
templates.
|
154
|
+
|
155
|
+
* actions
|
156
|
+
Caching compiled actions.
|
157
|
+
|
158
|
+
* patterns
|
159
|
+
This is used in Controller::resolve to cache the generated patterns for a
|
160
|
+
path.
|
161
|
+
|
162
|
+
* resolved
|
163
|
+
Caching the resolved but not yet compiled actions by their path.
|
164
|
+
|
165
|
+
* shield
|
166
|
+
Caching the generated errors for the path, so on repeated erronous
|
167
|
+
requests no new error-page has to be generated.
|
168
|
+
|
169
|
+
* Controller::startup
|
170
|
+
* mapping of all subclassed Controller
|
171
|
+
* validation of mapping
|
172
|
+
* validation of template_root
|
173
|
+
|
174
|
+
* Session::startup
|
175
|
+
* adds Cache.sessions if Global.sessions is true
|
176
|
+
This cache is used to store all sessions with their session-id as key.
|
177
|
+
|
178
|
+
* SourceReload::startup
|
179
|
+
* start with Global.reload_interval
|
180
|
+
* assign Global.sourcereload
|
181
|
+
|
182
|
+
* Adapter::startup
|
183
|
+
* interpret Global.adapter
|
184
|
+
* add every created adapter to Global.adapters
|
185
|
+
|
186
|
+
|
187
|
+
Tasks on shutdown
|
188
|
+
|
189
|
+
* Adapter::shutdown (iterates Global.adapters)
|
190
|
+
* Inform::shutdown (iterates all in LogHub)
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
#### Global configuration
|
195
|
+
|
196
|
+
Any serious application or framework needs to be configured.
|
197
|
+
Yes, I wished there was a silver bullet to serve all your needs as well, but at
|
198
|
+
the current stage of programming development there is no such thing.
|
199
|
+
So, since we need to configure, we should make it as simple and painless as
|
200
|
+
possible, and, thanks to Ruby, it is actually quite enjoyable to do that.
|
201
|
+
You can find a very detailed description about Global in the section about
|
202
|
+
Configuration, for now just the basics.
|
203
|
+
|
204
|
+
The basis of Ramaze::Global, the instance that is holding most part of your
|
205
|
+
configuration or at least links to the actual places, is the
|
206
|
+
Ramaze::GlobalStruct (ramaze/global.rb), which is a subclass of OpenStruct. If
|
207
|
+
you are not yet familiar with OpenStruct, I very much recommend to read its
|
208
|
+
documentation and play around a bit, it is basically just a wrapper around a
|
209
|
+
normal Hash where you can access the keys instead of ostruct[:foo] with
|
210
|
+
ostruct.foo.
|
211
|
+
It simply defines a new accessors on assignment by catching things in
|
212
|
+
method_missing. I won't go into more details here, I hope you got the principle.
|
213
|
+
|
214
|
+
Now, based on this technique, GlobalStruct adds things like defaults and a
|
215
|
+
couple of convenience methods like they are common in Ruby, giving you more
|
216
|
+
power by tapping to the internal Hash of the GlobalStruct and adding
|
217
|
+
update/setup methods so you can assign many key/value pairs at once.
|
218
|
+
The RDocs will give you a very good overview of what is available and how one is
|
219
|
+
supposed to work with it.
|
220
|
+
|
221
|
+
Now back to the big picture.
|
222
|
+
|
223
|
+
Ramaze accesses Global all over the place, there have been made several choices
|
224
|
+
as to why using something like Global is considered beneficial against choosing
|
225
|
+
for example global variables, which would be considered as a fatal choice by
|
226
|
+
any respected Rubyist anyway.
|
227
|
+
|
228
|
+
Now to something more subtle, which has to do with Global. I speak about traits,
|
229
|
+
which is a very different concept in most of its implementations, but it is
|
230
|
+
something that basically fits this name. It is configuration of single Objects
|
231
|
+
and whole ancestries.
|
232
|
+
You can give an object a trait, and most likely will use it along the lines of
|
233
|
+
something like MyController.trait(:map => '/'), which would be picked up on
|
234
|
+
startup and used to create Global.mapping - where we are at configuration again.
|
235
|
+
Choosing this style of configuration complementary to a central place to put all
|
236
|
+
your configuration was made very early in the development of Ramaze, and the
|
237
|
+
basic code of how traits are implemented and used has proven very efficient both
|
238
|
+
in understanding and using them.
|
239
|
+
|
240
|
+
There is a basic distinction when to use Global and when to use traits and when
|
241
|
+
to generate or assume one based on the other.
|
242
|
+
|
243
|
+
If something affects your whole application and is either used directly in the
|
244
|
+
Ramaze module or throughout the framework it is considered to be put into Global
|
245
|
+
to gain benefits of better documentation and accessibility.
|
246
|
+
|
247
|
+
On the other hand - if something is used in a configuring manner by a class that
|
248
|
+
is instantiated often (like Controller is for example), or a module that cannot
|
249
|
+
hold instance variables in a nice manner and is also not a constant - then it is
|
250
|
+
configured using traits.
|
251
|
+
|
252
|
+
|
253
|
+
Ramaze
|
254
|
+
Global
|
255
|
+
Adapter
|
256
|
+
Dispatcher
|
257
|
+
Controller
|
258
|
+
Action
|
259
|
+
|
260
|
+
Session
|
261
|
+
Helper
|
262
|
+
Tool
|
263
|
+
|
264
|
+
|
265
|
+
#### The Web
|
266
|
+
|
267
|
+
The so called web consists of a plethora of data, most of it is browsable
|
268
|
+
through a web browser that just about every toaster has installed these days.
|
269
|
+
The browser is the target of a web author, trying to utilize common standards
|
270
|
+
like HTML and CSS which are means for data and layout to be combined, giving the
|
271
|
+
browser a way to display the data.
|
272
|
+
Ramaze works on the URI-scale web, meaning that addresses like
|
273
|
+
http://someserver.com/blog/article/1 have a unique representation on your
|
274
|
+
server.
|
275
|
+
If we stay with this example, we see already everything Ramaze needs to see to
|
276
|
+
serve a page based on your instructions.
|
277
|
+
We assume that blog/article is a Controller named ArticleController in the blog
|
278
|
+
application.
|
data/doc/meta/users.kml
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<kml xmlns="http://earth.google.com/kml/2.2">
|
3
|
+
<Document>
|
4
|
+
<Placemark>
|
5
|
+
<name>manveru</name>
|
6
|
+
<description><![CDATA[ <img src="http://manveru.mine.nu/public/me.png" /><br />
|
7
|
+
Tokyo, Japan ]]>
|
8
|
+
</description>
|
9
|
+
<Point>
|
10
|
+
<coordinates>139.667846,35.614759</coordinates>
|
11
|
+
</Point>
|
12
|
+
</Placemark>
|
13
|
+
<Placemark>
|
14
|
+
<name>Pistos</name>
|
15
|
+
<description>
|
16
|
+
<![CDATA[
|
17
|
+
<img src="http://purepistos.net/favicon32.png" alt="Pistos" /><br />
|
18
|
+
Toronto, Canada<br />
|
19
|
+
<a href="http://blog.purepistos.net">blog.purepistos.net</a>
|
20
|
+
]]>
|
21
|
+
</description>
|
22
|
+
<Point>
|
23
|
+
<coordinates>-79.386985,43.642515,0</coordinates>
|
24
|
+
</Point>
|
25
|
+
</Placemark>
|
26
|
+
<Placemark>
|
27
|
+
<name>MonoDelDiablo</name>
|
28
|
+
<description><![CDATA[ Seattle, Washington, United States ]]></description>
|
29
|
+
<Point>
|
30
|
+
<coordinates>-122.266881,47.682765,0</coordinates>
|
31
|
+
</Point>
|
32
|
+
</Placemark>
|
33
|
+
<Placemark>
|
34
|
+
<name>Kashia</name>
|
35
|
+
<description><![CDATA[ Helsinki, Etela-Suomen Laani, Finland ]]></description>
|
36
|
+
<Point>
|
37
|
+
<coordinates>8.447204,49.028928,0</coordinates>
|
38
|
+
</Point>
|
39
|
+
</Placemark>
|
40
|
+
<Placemark>
|
41
|
+
<name>zenix</name>
|
42
|
+
<description><![CDATA[ Gaithersburg, Maryland, United States ]]></description>
|
43
|
+
<Point>
|
44
|
+
<coordinates>-77.183338,39.137049,0</coordinates>
|
45
|
+
</Point>
|
46
|
+
</Placemark>
|
47
|
+
<Placemark>
|
48
|
+
<name>tmm1</name>
|
49
|
+
<description><![CDATA[ <img src="http://tmm1.net/me.jpg" /><br />
|
50
|
+
Boston, Massachussetts ]]>
|
51
|
+
</description>
|
52
|
+
<Point>
|
53
|
+
<coordinates>-71.084371,42.365975,0</coordinates>
|
54
|
+
</Point>
|
55
|
+
</Placemark>
|
56
|
+
<Placemark>
|
57
|
+
<name>riffraff</name>
|
58
|
+
<description><![CDATA[ Rome, Italia ]]></description>
|
59
|
+
<Point>
|
60
|
+
<coordinates>41.993372,12.087193,0</coordinates>
|
61
|
+
</Point>
|
62
|
+
</Placemark>
|
63
|
+
</Document>
|
64
|
+
</kml>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
There are some examples for your instant pleasure inside the examples-directory
|
2
|
+
in the Ramaze-distribution.
|
3
|
+
To start up an example, you can use the Ramaze binary located in bin/ramaze
|
4
|
+
for example:
|
5
|
+
|
6
|
+
$ ramaze examples/hello.rb
|
7
|
+
|
8
|
+
Or:
|
9
|
+
|
10
|
+
$ cd examples/blog
|
11
|
+
$ ramaze
|
12
|
+
|
13
|
+
Since ramaze uses the start.rb by default if you don't pass anything else.
|
14
|
+
|
15
|
+
For more information about the usage of ramaze try:
|
16
|
+
|
17
|
+
$ ramaze --help
|
18
|
+
|
19
|
+
|
20
|
+
Examples include:
|
21
|
+
|
22
|
+
* examples/hello.rb
|
23
|
+
Hello, World!
|
24
|
+
|
25
|
+
* examples/simple.rb
|
26
|
+
A bit more advanced than the hello-example, but still very basic.
|
27
|
+
|
28
|
+
* examples/blog
|
29
|
+
Not yet fully functional, but coming along.
|
30
|
+
|
31
|
+
* examples/whywiki
|
32
|
+
A basic examples of a minimalistic application, based on the Wiki of \_why in
|
33
|
+
his camping-framework.
|
34
|
+
|
35
|
+
* examples/templates
|
36
|
+
examples of real usage of the templating-engines. Tries to implement the same
|
37
|
+
functionality in each `template_*.rb` file using a different engine.
|
38
|
+
|