clivecrous-ramaze 0.3.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +444 -0
- data/Rakefile +197 -0
- data/bin/ramaze +60 -0
- data/doc/AUTHORS +30 -0
- data/doc/CHANGELOG +5757 -0
- data/doc/COPYING +56 -0
- data/doc/FAQ +92 -0
- data/doc/GPL +339 -0
- data/doc/INSTALL +34 -0
- data/doc/LEGAL +26 -0
- data/doc/ProjectInfo +53 -0
- data/doc/TODO +29 -0
- data/doc/meta/announcement.txt +126 -0
- data/doc/meta/configuration.txt +162 -0
- data/doc/meta/internals.txt +278 -0
- data/doc/meta/users.kml +64 -0
- data/doc/migrate/1110_to_1111.txt +131 -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 +55 -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 +816 -0
- data/doc/tutorial/todolist.mkd +736 -0
- data/examples/auth/auth.rb +54 -0
- data/examples/auth/template/layout.haml +20 -0
- data/examples/auth/template/login.haml +16 -0
- data/examples/blog/README +3 -0
- data/examples/blog/controller/main.rb +29 -0
- data/examples/blog/model/entry.rb +30 -0
- data/examples/blog/public/styles/blog.css +132 -0
- data/examples/blog/spec/blog.rb +87 -0
- data/examples/blog/start.rb +7 -0
- data/examples/blog/view/edit.xhtml +17 -0
- data/examples/blog/view/index.xhtml +17 -0
- data/examples/blog/view/layout.xhtml +11 -0
- data/examples/blog/view/new.xhtml +16 -0
- data/examples/caching.rb +31 -0
- data/examples/chat/model/history.rb +36 -0
- data/examples/chat/model/message.rb +7 -0
- data/examples/chat/public/js/jquery.js +3436 -0
- data/examples/chat/start.rb +40 -0
- data/examples/chat/view/chat.xhtml +29 -0
- data/examples/chat/view/index.xhtml +6 -0
- data/examples/chat/view/layout.xhtml +12 -0
- data/examples/css.rb +37 -0
- data/examples/element.rb +45 -0
- data/examples/facebook.rb +159 -0
- data/examples/hello.rb +15 -0
- data/examples/httpdigest.rb +50 -0
- data/examples/identity.rb +18 -0
- data/examples/layout.rb +28 -0
- data/examples/linking.rb +29 -0
- data/examples/localization/start.rb +35 -0
- data/examples/memleak_detector.rb +32 -0
- data/examples/nitro_form.rb +23 -0
- data/examples/provide.rb +23 -0
- data/examples/ramaise.rb +132 -0
- data/examples/rammit/spec/rammit.rb +31 -0
- data/examples/rammit/src/controller/main.rb +3 -0
- data/examples/rammit/src/controller/page.rb +16 -0
- data/examples/rammit/src/model.rb +33 -0
- data/examples/rammit/start.rb +8 -0
- data/examples/rammit/template/index.xhtml +14 -0
- data/examples/rammit/template/page/view.xhtml +4 -0
- data/examples/rapaste/Rakefile +35 -0
- data/examples/rapaste/controller/paste.rb +94 -0
- data/examples/rapaste/model/paste.rb +55 -0
- data/examples/rapaste/public/css/active4d.css +114 -0
- data/examples/rapaste/public/css/all_hallows_eve.css +72 -0
- data/examples/rapaste/public/css/amy.css +147 -0
- data/examples/rapaste/public/css/blackboard.css +88 -0
- data/examples/rapaste/public/css/brilliance_black.css +605 -0
- data/examples/rapaste/public/css/brilliance_dull.css +599 -0
- data/examples/rapaste/public/css/cobalt.css +149 -0
- data/examples/rapaste/public/css/dawn.css +121 -0
- data/examples/rapaste/public/css/display.css +197 -0
- data/examples/rapaste/public/css/eiffel.css +121 -0
- data/examples/rapaste/public/css/espresso_libre.css +109 -0
- data/examples/rapaste/public/css/idle.css +62 -0
- data/examples/rapaste/public/css/iplastic.css +80 -0
- data/examples/rapaste/public/css/lazy.css +73 -0
- data/examples/rapaste/public/css/mac_classic.css +123 -0
- data/examples/rapaste/public/css/magicwb_amiga.css +104 -0
- data/examples/rapaste/public/css/pastels_on_dark.css +188 -0
- data/examples/rapaste/public/css/slush_poppies.css +85 -0
- data/examples/rapaste/public/css/spacecadet.css +51 -0
- data/examples/rapaste/public/css/sunburst.css +180 -0
- data/examples/rapaste/public/css/twilight.css +137 -0
- data/examples/rapaste/public/css/zenburnesque.css +91 -0
- data/examples/rapaste/public/js/jquery.js +11 -0
- data/examples/rapaste/spec/rapaste.rb +49 -0
- data/examples/rapaste/start.rb +24 -0
- data/examples/rapaste/view/copy.xhtml +10 -0
- data/examples/rapaste/view/index.xhtml +9 -0
- data/examples/rapaste/view/layout.xhtml +25 -0
- data/examples/rapaste/view/list.xhtml +29 -0
- data/examples/rapaste/view/search.xhtml +41 -0
- data/examples/rapaste/view/view.xhtml +37 -0
- data/examples/rapp.rb +45 -0
- data/examples/rest.rb +28 -0
- data/examples/sequel_form.rb +24 -0
- data/examples/sequel_scaffolding.rb +24 -0
- data/examples/simple.rb +56 -0
- data/examples/simple_auth.rb +23 -0
- data/examples/sourceview/public/coderay.css +104 -0
- data/examples/sourceview/public/images/file.gif +0 -0
- data/examples/sourceview/public/images/folder.gif +0 -0
- data/examples/sourceview/public/images/tv-collapsable-last.gif +0 -0
- data/examples/sourceview/public/images/tv-collapsable.gif +0 -0
- data/examples/sourceview/public/images/tv-expandable-last.gif +0 -0
- data/examples/sourceview/public/images/tv-expandable.gif +0 -0
- data/examples/sourceview/public/images/tv-item-last.gif +0 -0
- data/examples/sourceview/public/images/tv-item.gif +0 -0
- data/examples/sourceview/public/jquery.js +11 -0
- data/examples/sourceview/public/jquery.treeview.css +48 -0
- data/examples/sourceview/public/jquery.treeview.js +223 -0
- data/examples/sourceview/public/sourceview.js +52 -0
- data/examples/sourceview/sourceview.rb +77 -0
- data/examples/sourceview/template/index.haml +59 -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/examples/todolist/README +1 -0
- data/examples/todolist/public/favicon.ico +0 -0
- data/examples/todolist/public/js/jquery.js +1923 -0
- data/examples/todolist/public/ramaze.png +0 -0
- data/examples/todolist/spec/todolist.rb +132 -0
- data/examples/todolist/src/controller/main.rb +70 -0
- data/examples/todolist/src/element/page.rb +31 -0
- data/examples/todolist/src/model.rb +14 -0
- data/examples/todolist/start.rb +11 -0
- data/examples/todolist/template/index.xhtml +17 -0
- data/examples/todolist/template/new.xhtml +7 -0
- data/examples/upload/start.rb +19 -0
- data/examples/upload/view/index.xhtml +25 -0
- data/examples/whywiki/spec/whywiki.rb +58 -0
- data/examples/whywiki/start.rb +46 -0
- data/examples/whywiki/template/edit.xhtml +14 -0
- data/examples/whywiki/template/show.xhtml +18 -0
- data/examples/wikore/spec/wikore.rb +111 -0
- data/examples/wikore/src/controller.rb +80 -0
- data/examples/wikore/src/model.rb +52 -0
- data/examples/wikore/start.rb +9 -0
- data/examples/wikore/template/index.xhtml +8 -0
- data/examples/wiktacular/README +2 -0
- data/examples/wiktacular/mkd/link/2007-07-20_19-45-51.mkd +1 -0
- data/examples/wiktacular/mkd/link/current.mkd +1 -0
- data/examples/wiktacular/mkd/main/2007-07-20_16-31-33.mkd +1 -0
- data/examples/wiktacular/mkd/main/2007-07-20_19-21-12.mkd +1 -0
- data/examples/wiktacular/mkd/main/2007-07-20_19-23-10.mkd +2 -0
- data/examples/wiktacular/mkd/main/2007-07-20_19-45-07.mkd +2 -0
- data/examples/wiktacular/mkd/main/current.mkd +2 -0
- data/examples/wiktacular/mkd/markdown/current.mkd +3 -0
- data/examples/wiktacular/mkd/testing/2007-07-20_16-43-46.mkd +2 -0
- data/examples/wiktacular/mkd/testing/2007-07-20_19-43-50.mkd +3 -0
- data/examples/wiktacular/mkd/testing/2007-07-21_18-46-01.mkd +11 -0
- data/examples/wiktacular/mkd/testing/2007-07-21_18-46-32.mkd +13 -0
- data/examples/wiktacular/mkd/testing/2007-07-21_18-47-08.mkd +17 -0
- data/examples/wiktacular/mkd/testing/2007-07-21_18-47-54.mkd +17 -0
- data/examples/wiktacular/mkd/testing/current.mkd +17 -0
- data/examples/wiktacular/public/favicon.ico +0 -0
- data/examples/wiktacular/public/screen.css +72 -0
- data/examples/wiktacular/spec/wiktacular.rb +158 -0
- data/examples/wiktacular/src/controller.rb +55 -0
- data/examples/wiktacular/src/model.rb +102 -0
- data/examples/wiktacular/start.rb +8 -0
- data/examples/wiktacular/template/edit.xhtml +6 -0
- data/examples/wiktacular/template/html_layout.xhtml +27 -0
- data/examples/wiktacular/template/index.xhtml +9 -0
- data/examples/wiktacular/template/new.xhtml +6 -0
- data/lib/proto/controller/main.rb +22 -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 +3436 -0
- data/lib/proto/public/ramaze.png +0 -0
- data/lib/proto/spec/main.rb +24 -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.rb +108 -0
- data/lib/ramaze/action.rb +153 -0
- data/lib/ramaze/action/render.rb +191 -0
- data/lib/ramaze/adapter.rb +101 -0
- data/lib/ramaze/adapter/base.rb +103 -0
- data/lib/ramaze/adapter/cgi.rb +24 -0
- data/lib/ramaze/adapter/ebb.rb +22 -0
- data/lib/ramaze/adapter/evented_mongrel.rb +7 -0
- data/lib/ramaze/adapter/fcgi.rb +24 -0
- data/lib/ramaze/adapter/lsws.rb +23 -0
- data/lib/ramaze/adapter/mongrel.rb +25 -0
- data/lib/ramaze/adapter/scgi.rb +22 -0
- data/lib/ramaze/adapter/swiftiplied_mongrel.rb +7 -0
- data/lib/ramaze/adapter/thin.rb +22 -0
- data/lib/ramaze/adapter/webrick.rb +52 -0
- data/lib/ramaze/cache.rb +115 -0
- data/lib/ramaze/cache/memcached.rb +71 -0
- data/lib/ramaze/cache/memory.rb +6 -0
- data/lib/ramaze/cache/yaml_store.rb +68 -0
- data/lib/ramaze/contrib.rb +82 -0
- data/lib/ramaze/contrib/auto_params.rb +135 -0
- data/lib/ramaze/contrib/auto_params/get_args.rb +57 -0
- data/lib/ramaze/contrib/email.rb +84 -0
- data/lib/ramaze/contrib/facebook.rb +23 -0
- data/lib/ramaze/contrib/facebook/facebook.rb +171 -0
- data/lib/ramaze/contrib/file_cache.rb +65 -0
- data/lib/ramaze/contrib/gems.rb +65 -0
- data/lib/ramaze/contrib/gettext.rb +113 -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/gzip_filter.rb +56 -0
- data/lib/ramaze/contrib/profiling.rb +36 -0
- data/lib/ramaze/contrib/rest.rb +14 -0
- data/lib/ramaze/contrib/sequel/fill.rb +12 -0
- data/lib/ramaze/contrib/sequel_cache.rb +92 -0
- data/lib/ramaze/controller.rb +281 -0
- data/lib/ramaze/controller/error.rb +46 -0
- data/lib/ramaze/controller/main.rb +2 -0
- data/lib/ramaze/controller/resolve.rb +252 -0
- data/lib/ramaze/current.rb +70 -0
- data/lib/ramaze/current/request.rb +204 -0
- data/lib/ramaze/current/response.rb +27 -0
- data/lib/ramaze/current/session.rb +181 -0
- data/lib/ramaze/current/session/flash.rb +79 -0
- data/lib/ramaze/current/session/hash.rb +66 -0
- data/lib/ramaze/dispatcher.rb +137 -0
- data/lib/ramaze/dispatcher/action.rb +41 -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/error.rb +24 -0
- data/lib/ramaze/gestalt.rb +129 -0
- data/lib/ramaze/helper.rb +78 -0
- data/lib/ramaze/helper/aspect.rb +110 -0
- data/lib/ramaze/helper/auth.rb +125 -0
- data/lib/ramaze/helper/cache.rb +140 -0
- data/lib/ramaze/helper/cgi.rb +47 -0
- data/lib/ramaze/helper/flash.rb +59 -0
- data/lib/ramaze/helper/form.rb +281 -0
- data/lib/ramaze/helper/formatting.rb +118 -0
- data/lib/ramaze/helper/httpdigest.rb +49 -0
- data/lib/ramaze/helper/identity.rb +105 -0
- data/lib/ramaze/helper/link.rb +124 -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/partial.rb +96 -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/stack.rb +72 -0
- data/lib/ramaze/helper/tagz.rb +19 -0
- data/lib/ramaze/helper/user.rb +78 -0
- data/lib/ramaze/log.rb +27 -0
- data/lib/ramaze/log/analogger.rb +37 -0
- data/lib/ramaze/log/growl.rb +35 -0
- data/lib/ramaze/log/hub.rb +38 -0
- data/lib/ramaze/log/informer.rb +125 -0
- data/lib/ramaze/log/knotify.rb +25 -0
- data/lib/ramaze/log/logger.rb +23 -0
- data/lib/ramaze/log/logging.rb +88 -0
- data/lib/ramaze/log/syslog.rb +36 -0
- data/lib/ramaze/log/xosd.rb +88 -0
- data/lib/ramaze/option.rb +153 -0
- data/lib/ramaze/option/dsl.rb +45 -0
- data/lib/ramaze/option/holder.rb +143 -0
- data/lib/ramaze/option/merger.rb +106 -0
- data/lib/ramaze/route.rb +97 -0
- data/lib/ramaze/setup.rb +50 -0
- data/lib/ramaze/snippets.rb +9 -0
- data/lib/ramaze/snippets/array/put_within.rb +37 -0
- data/lib/ramaze/snippets/binding/locals.rb +13 -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/kernel/__dir__.rb +23 -0
- data/lib/ramaze/snippets/kernel/acquire.rb +34 -0
- data/lib/ramaze/snippets/kernel/constant.rb +26 -0
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +15 -0
- data/lib/ramaze/snippets/metaid.rb +17 -0
- data/lib/ramaze/snippets/numeric/filesize_format.rb +25 -0
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +8 -0
- data/lib/ramaze/snippets/object/pretty.rb +6 -0
- data/lib/ramaze/snippets/object/scope.rb +11 -0
- data/lib/ramaze/snippets/object/thread_accessor.rb +5 -0
- data/lib/ramaze/snippets/object/traits.rb +76 -0
- data/lib/ramaze/snippets/ordered_set.rb +40 -0
- data/lib/ramaze/snippets/proc/locals.rb +11 -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 +7 -0
- data/lib/ramaze/snippets/ramaze/thread_accessor.rb +58 -0
- data/lib/ramaze/snippets/string/camel_case.rb +16 -0
- data/lib/ramaze/snippets/string/color.rb +27 -0
- data/lib/ramaze/snippets/string/each.rb +8 -0
- data/lib/ramaze/snippets/string/esc.rb +29 -0
- data/lib/ramaze/snippets/string/ord.rb +15 -0
- data/lib/ramaze/snippets/string/snake_case.rb +15 -0
- data/lib/ramaze/snippets/string/start_with.rb +8 -0
- data/lib/ramaze/snippets/string/unindent.rb +20 -0
- data/lib/ramaze/snippets/struct/fill.rb +23 -0
- data/lib/ramaze/snippets/struct/values_at.rb +24 -0
- data/lib/ramaze/snippets/symbol/to_proc.rb +24 -0
- data/lib/ramaze/snippets/thread/into.rb +18 -0
- data/lib/ramaze/sourcereload.rb +169 -0
- data/lib/ramaze/spec.rb +1 -0
- data/lib/ramaze/spec/helper.rb +131 -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 +69 -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 +6 -0
- data/lib/ramaze/store/default.rb +109 -0
- data/lib/ramaze/template.rb +84 -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.rb +42 -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/haml.rb +37 -0
- data/lib/ramaze/template/liquid.rb +36 -0
- data/lib/ramaze/template/markaby.rb +52 -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/tool.rb +9 -0
- data/lib/ramaze/tool/create.rb +74 -0
- data/lib/ramaze/tool/localize.rb +198 -0
- data/lib/ramaze/tool/mime.rb +25 -0
- data/lib/ramaze/tool/mime_types.yaml +615 -0
- data/lib/ramaze/tool/record.rb +6 -0
- data/lib/ramaze/trinity.rb +13 -0
- data/lib/ramaze/version.rb +14 -0
- data/lib/vendor/bacon.rb +323 -0
- data/rake_tasks/conf.rake +83 -0
- data/rake_tasks/coverage.rake +46 -0
- data/rake_tasks/darcs.rake +14 -0
- data/rake_tasks/gem.rake +85 -0
- data/rake_tasks/git.rake +4 -0
- data/rake_tasks/maintenance.rake +436 -0
- data/rake_tasks/spec.rake +62 -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 +25 -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 +48 -0
- data/spec/ramaze/action/layout.rb +190 -0
- data/spec/ramaze/action/render.rb +32 -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.rb +39 -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/cache.rb +140 -0
- data/spec/ramaze/controller.rb +177 -0
- data/spec/ramaze/controller/actionless_templates.rb +32 -0
- data/spec/ramaze/controller/resolve.rb +32 -0
- data/spec/ramaze/controller/subclass.rb +21 -0
- data/spec/ramaze/controller/template_resolving.rb +113 -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/current/request.rb +30 -0
- data/spec/ramaze/current/session.rb +97 -0
- data/spec/ramaze/dispatcher.rb +31 -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/element.rb +107 -0
- data/spec/ramaze/error.rb +94 -0
- data/spec/ramaze/gestalt.rb +131 -0
- data/spec/ramaze/helper/aspect.rb +92 -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 +41 -0
- data/spec/ramaze/helper/link.rb +124 -0
- data/spec/ramaze/helper/pager.rb +99 -0
- data/spec/ramaze/helper/partial.rb +76 -0
- data/spec/ramaze/helper/redirect.rb +112 -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 +10 -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.rb +185 -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/rewrite.rb +36 -0
- data/spec/ramaze/rewrite/file.css +1 -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/template.rb +128 -0
- data/spec/ramaze/template/amrita2.rb +50 -0
- data/spec/ramaze/template/amrita2/external.amrita +6 -0
- data/spec/ramaze/template/amrita2/sum.amrita +1 -0
- data/spec/ramaze/template/builder.rb +55 -0
- data/spec/ramaze/template/builder/external.rxml +3 -0
- data/spec/ramaze/template/erubis.rb +41 -0
- data/spec/ramaze/template/erubis/sum.rhtml +1 -0
- data/spec/ramaze/template/ezamar.rb +63 -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/haml.rb +66 -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/liquid.rb +99 -0
- data/spec/ramaze/template/liquid/index.liquid +1 -0
- data/spec/ramaze/template/liquid/products.liquid +45 -0
- data/spec/ramaze/template/markaby.rb +61 -0
- data/spec/ramaze/template/markaby/external.mab +8 -0
- data/spec/ramaze/template/markaby/sum.mab +1 -0
- data/spec/ramaze/template/nagoro.rb +64 -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/ramaze/external.test +1 -0
- data/spec/ramaze/template/redcloth.rb +38 -0
- data/spec/ramaze/template/redcloth/external.redcloth +1 -0
- data/spec/ramaze/template/remarkably.rb +58 -0
- data/spec/ramaze/template/remarkably/external.rem +8 -0
- data/spec/ramaze/template/remarkably/sum.rem +1 -0
- data/spec/ramaze/template/sass.rb +69 -0
- data/spec/ramaze/template/sass/file.css.sass +5 -0
- data/spec/ramaze/template/tagz.rb +62 -0
- data/spec/ramaze/template/tagz/external.tagz +8 -0
- data/spec/ramaze/template/tagz/sum.tagz +1 -0
- data/spec/ramaze/template/tenjin.rb +47 -0
- data/spec/ramaze/template/tenjin/external.tenjin +1 -0
- data/spec/ramaze/template/xslt.rb +90 -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/snippets/array/put_within.rb +33 -0
- data/spec/snippets/divide.rb +19 -0
- data/spec/snippets/kernel/__dir__.rb +8 -0
- data/spec/snippets/kernel/acquire.rb +71 -0
- data/spec/snippets/kernel/constant.rb +23 -0
- data/spec/snippets/numeric/filesize_format.rb +12 -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/struct/fill.rb +26 -0
- data/spec/snippets/struct/values_at.rb +44 -0
- data/spec/snippets/symbol/to_proc.rb +13 -0
- data/spec/snippets/thread/into.rb +20 -0
- metadata +789 -0
data/doc/INSTALL
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
= Installating Ramaze
|
2
|
+
|
3
|
+
* via RubyGems
|
4
|
+
|
5
|
+
The simplest way of installing Ramaze is via
|
6
|
+
|
7
|
+
$ gem install ramaze
|
8
|
+
|
9
|
+
in case you have RubyGems installed.
|
10
|
+
(this will work as soon as I have registered on RubyForge ;)
|
11
|
+
|
12
|
+
* via install.rb
|
13
|
+
|
14
|
+
Ramaze provides a basic install.rb that should take care of the installation
|
15
|
+
you can use it like
|
16
|
+
|
17
|
+
$ ruby install.rb
|
18
|
+
|
19
|
+
you may need root-privileges to do
|
20
|
+
that, depending on what options you provide.
|
21
|
+
(please note that I haven't tested the install.rb extensively yet, so if you
|
22
|
+
find some quirks, please send me patches or a simple note)
|
23
|
+
|
24
|
+
* via darcs
|
25
|
+
|
26
|
+
To get the latest and sweetest, you can just pull from the repository and run
|
27
|
+
Ramaze that way.
|
28
|
+
|
29
|
+
$ darcs get --partial http://manveru.mine.nu/ramaze
|
30
|
+
|
31
|
+
Please read the man page or `darcs help` for more information about updating
|
32
|
+
and creating your own patches.
|
33
|
+
This is at the moment the premier way to use Ramaze, since it is the way I use
|
34
|
+
it.
|
data/doc/LEGAL
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
This is a list of files included into ramaze but under different licenses.
|
2
|
+
Also included are files that are not under the copyright from Michael Fellinger.
|
3
|
+
|
4
|
+
lib/ramaze/helper/pager.rb
|
5
|
+
License: BSD License
|
6
|
+
Author: George K. Moschovitis
|
7
|
+
|
8
|
+
lib/ramaze/snippets/dictionary.rb
|
9
|
+
License: Ruby License
|
10
|
+
Authors: Jan Molic and Thomas Sawyer
|
11
|
+
|
12
|
+
lib/proto/js/jquery.js
|
13
|
+
License: Dual licensed under MIT and GPL
|
14
|
+
Author: John Resig
|
15
|
+
|
16
|
+
lib/ramaze/spec/helper/simple_http.rb
|
17
|
+
License: GPL
|
18
|
+
Author: Tim Becker
|
19
|
+
|
20
|
+
lib/ramaze/template/xslt.rb
|
21
|
+
License: Ruby
|
22
|
+
Author: Stephan Maka
|
23
|
+
|
24
|
+
lib/vendor/bacon.rb
|
25
|
+
License: MIT
|
26
|
+
Author: Christian Neukirchen
|
data/doc/ProjectInfo
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
project : ramaze
|
3
|
+
version : '0.0.7'
|
4
|
+
status : alpha
|
5
|
+
|
6
|
+
title : Ramaze
|
7
|
+
subtitle : A light and modular Web-Framework
|
8
|
+
description : >
|
9
|
+
Ramaze is a very simple and straight-forward web-framework.
|
10
|
+
The philosophy of it could be expressed in a mix of KISS and POLS, trying to
|
11
|
+
make simple things simple and complex things possible.
|
12
|
+
|
13
|
+
author : Michael Fellinger <m.fellinger@gmail.com>
|
14
|
+
created : "2006-10-14"
|
15
|
+
homepage : "http://ramaze.rubyforge.org"
|
16
|
+
download : "https://rubyforge.org/frs/?group_id=3034"
|
17
|
+
repository : "http://manveru.mine.nu/darcs/ramaze"
|
18
|
+
slogan : Ramaze, light and modular
|
19
|
+
#signiture : "../_privkey.pem"
|
20
|
+
|
21
|
+
pack : [gem, tgz, bz2]
|
22
|
+
distribute : [ -scrap ]
|
23
|
+
dependency :
|
24
|
+
- [ autorake, >= 0.5.1 ]
|
25
|
+
executable : [ bin/ramaze ]
|
26
|
+
|
27
|
+
#digest : sha256
|
28
|
+
#manifest : MANIFEST.txt
|
29
|
+
archive : ~/ruby/ARCHIVE
|
30
|
+
scm : darcs
|
31
|
+
scm_ignore : [ doc/allison ]
|
32
|
+
changelog : doc/CHANGELOG
|
33
|
+
stamp : doc/VERSION
|
34
|
+
|
35
|
+
rdoc:
|
36
|
+
template : allison
|
37
|
+
|
38
|
+
mail:
|
39
|
+
server : smtp.gmail.com
|
40
|
+
account : m.fellinger@gmail.com
|
41
|
+
mail_to : m.fellinger@gmail.com
|
42
|
+
|
43
|
+
rubyforge:
|
44
|
+
project : ramaze
|
45
|
+
username : manveru
|
46
|
+
groupid : 3034
|
47
|
+
package : ramaze
|
48
|
+
|
49
|
+
#host:
|
50
|
+
# domain : rubyforge.org
|
51
|
+
# user : transami
|
52
|
+
# root : '/var/www/gforge-projects/ratchets'
|
53
|
+
|
data/doc/TODO
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
This list is programmaticly generated by `rake todolist`
|
2
|
+
If you want to add/remove items from the list, change them at the
|
3
|
+
position specified in the list.
|
4
|
+
|
5
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/template/ezamar/morpher.rb
|
6
|
+
- Add pure Ruby implementation as a fall-back.
|
7
|
+
|
8
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/helper/pager.rb
|
9
|
+
++
|
10
|
+
|
11
|
+
/home/manveru/prog/projects/ramaze/spec/ramaze/action/basics.rb
|
12
|
+
|
13
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/template/ezamar/engine.rb
|
14
|
+
- provide C version or maybe use erbuis
|
15
|
+
|
16
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/template/xslt.rb
|
17
|
+
* Error handling
|
18
|
+
* Maybe prevent extFunction to be called by HTTP
|
19
|
+
|
20
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/helper/identity.rb
|
21
|
+
- maybe using StackHelper, but this is a really minimal overlap?
|
22
|
+
|
23
|
+
/home/manveru/prog/projects/ramaze/spec/snippets/ramaze/caller_info.rb
|
24
|
+
|
25
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/snippets/dictionary.rb
|
26
|
+
++
|
27
|
+
|
28
|
+
/home/manveru/prog/projects/ramaze/lib/ramaze/helper/redirect.rb
|
29
|
+
- maybe some more options, like a delay
|
@@ -0,0 +1,126 @@
|
|
1
|
+
This time we are proud to announce Version 0.3.5 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
|
+
View source: http://source.ramaze.net
|
17
|
+
Darcsweb: http://darcs.ramaze.net
|
18
|
+
|
19
|
+
IRC: #ramaze on irc.freenode.net
|
20
|
+
|
21
|
+
|
22
|
+
Simple example:
|
23
|
+
|
24
|
+
require 'ramaze'
|
25
|
+
|
26
|
+
class MainController
|
27
|
+
def index
|
28
|
+
'Hello, World!'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
Ramaze.start
|
33
|
+
|
34
|
+
|
35
|
+
Special (alphabetic) thanks go to:
|
36
|
+
|
37
|
+
Aman 'tmm1' Gupta - patches and support
|
38
|
+
Carlo Zottmann - first patch!
|
39
|
+
Chris 'celldee' Duncan - first patch!
|
40
|
+
Gabriele 'riffraff' Renzi - patches for file dispatcher
|
41
|
+
jeedee - new Ramaze logo
|
42
|
+
Jonathan 'Kashia' Buch - patches and support
|
43
|
+
Keita Yamaguchi - first patch!
|
44
|
+
Pistos - lots of friendly support
|
45
|
+
skaar - first patch!
|
46
|
+
|
47
|
+
|
48
|
+
Selected summary of the 62 patches from 0.3.0 to 0.3.5:
|
49
|
+
|
50
|
+
Core
|
51
|
+
- Ramaze::Contrib::Route made available by default as Ramaze::Route
|
52
|
+
(backwards compatibility retained)
|
53
|
+
- Support added for ETag and If-Modified-Since in Dispatcher::File
|
54
|
+
- Adapter for LiteSpeed webserver added
|
55
|
+
- Added ability to set default session cookie options using Session::COOKIE
|
56
|
+
- Support added for Content-Language based localization and gettext
|
57
|
+
|
58
|
+
Templates
|
59
|
+
- Support added for passing in locals to render_template
|
60
|
+
- Added support for symbol argument to template_root
|
61
|
+
- render_template no longer requires template extensions
|
62
|
+
- Dots allowed in template extensions (template.html.erb)
|
63
|
+
|
64
|
+
Templating Engines
|
65
|
+
- Builder templating engine added to produce XML
|
66
|
+
- RedCloth templating engine added
|
67
|
+
- Amrita2 templating engine updated to latest release
|
68
|
+
|
69
|
+
Helpers
|
70
|
+
- Simple EmailHelper added
|
71
|
+
- IdentityHelper updated for latest ruby-openid
|
72
|
+
- MarukuHelper added
|
73
|
+
- AuthHelper cleaned up
|
74
|
+
- LinkHelper improved: A(), R(), Rs() and breadcrumbs
|
75
|
+
|
76
|
+
Examples
|
77
|
+
- All examples were standardized to include rubygems
|
78
|
+
- Simple file upload example added
|
79
|
+
- Search and diff functionality added to Rapaste
|
80
|
+
|
81
|
+
Misc
|
82
|
+
- Read and read/write issues fixed in Ramaze::Store
|
83
|
+
- Fix applied for running Ramaze apps within IDEs on Windows
|
84
|
+
|
85
|
+
|
86
|
+
A complete Changelog is available at
|
87
|
+
http://darcs.ramaze.net/ramaze/doc/CHANGELOG
|
88
|
+
|
89
|
+
|
90
|
+
Known issues:
|
91
|
+
|
92
|
+
- none yet, waiting for your reports :)
|
93
|
+
|
94
|
+
|
95
|
+
Ramaze Features:
|
96
|
+
- Builds on top of the Rack library, which provides easy use of adapters like
|
97
|
+
Mongrel, WEBrick, LiteSpeed, Thin, CGI or FCGI.
|
98
|
+
|
99
|
+
- Supports a wide range of templating-engines like: Amrita2, Erubis, Haml,
|
100
|
+
Liquid, Markaby, Remarkably and its own engine called Ezamar and (still
|
101
|
+
unofficial) Nagoro.
|
102
|
+
|
103
|
+
- Highly modular structure: you can just use the parts you like. This also
|
104
|
+
means that it's very simple to add your own customizations.
|
105
|
+
|
106
|
+
- A variety of helpers is already available, giving you things like advanced
|
107
|
+
caching, OpenID-authentication or aspect-oriented programming for your
|
108
|
+
controllers.
|
109
|
+
|
110
|
+
- It is possible to use the ORM you like, be it Sequel, DataMapper,
|
111
|
+
ActiveRecord, Og, Kansas or something more simplistic like DBI, or a
|
112
|
+
wrapper around YAML::Store.
|
113
|
+
|
114
|
+
- Good documentation: although we don't have 100% documentation right now
|
115
|
+
(dcov says around 75%), just about every part of Ramaze is covered with
|
116
|
+
basic and advanced docs. There are a variety of examples, screencasts and a
|
117
|
+
tutorial available.
|
118
|
+
|
119
|
+
- Friendly community: there are people from all over the world using Ramaze,
|
120
|
+
so you can get almost instant help and info.
|
121
|
+
|
122
|
+
|
123
|
+
For more information please come to http://ramaze.net or ask directly on IRC
|
124
|
+
irc://irc.freenode.net/#ramaze
|
125
|
+
|
126
|
+
Thank you, Michael 'manveru' Fellinger and the Ramaze community
|
@@ -0,0 +1,162 @@
|
|
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.spawn = 10
|
22
|
+
|
23
|
+
if you do that before calling Ramaze::start Ramaze will spawn the given number of servers.
|
24
|
+
|
25
|
+
|
26
|
+
#### Multiple assignment:
|
27
|
+
|
28
|
+
Global.setup :adapter => :mongrel,
|
29
|
+
:cache => :memcached
|
30
|
+
|
31
|
+
So you can pass a Hash of all the options you want to change.
|
32
|
+
In this case you would use Mongrel as the adapter and use memcached for your
|
33
|
+
sessions and general caching.
|
34
|
+
|
35
|
+
|
36
|
+
#### Block assignment:
|
37
|
+
|
38
|
+
Global.setup do |g|
|
39
|
+
g.error_page = false
|
40
|
+
g.host = '127.0.0.1'
|
41
|
+
g.port = 7070
|
42
|
+
end
|
43
|
+
|
44
|
+
This method is similar to the hash-assignment, but may be preferred for some
|
45
|
+
applications.
|
46
|
+
|
47
|
+
|
48
|
+
#### Pass on Ramaze.start
|
49
|
+
|
50
|
+
Ramaze.start :run_loose => true
|
51
|
+
|
52
|
+
This way you can save a line or two in a small script.
|
53
|
+
Please note that the values passed here have precedence over the ones directly
|
54
|
+
set on Global and will overwrite them if you set them before, that is mostly
|
55
|
+
useful to quickly test some configuration.
|
56
|
+
|
57
|
+
|
58
|
+
### Global options
|
59
|
+
|
60
|
+
This listing is here to provide you with descriptions of the most common
|
61
|
+
configurations in alphabetical order per section showing the default value next
|
62
|
+
to the key.
|
63
|
+
|
64
|
+
This chapter has been shrunk a lot to cover only essentials, please look at
|
65
|
+
lib/ramaze/global.rb to see all available options.
|
66
|
+
|
67
|
+
Date of last update: 2007-05-20
|
68
|
+
|
69
|
+
#### General Configuration:
|
70
|
+
|
71
|
+
:sourcereload => 3
|
72
|
+
|
73
|
+
SourceReload is a nifty mechanism that takes advantage of the dynamics of Ruby,
|
74
|
+
it's basically a Thread that runs in the background and polls for files in the
|
75
|
+
application and framework that have changed (using mtime). The value specifies
|
76
|
+
roughly how fast your changes are going to be loaded and should be a number.
|
77
|
+
If you set this to false, it will not start.
|
78
|
+
|
79
|
+
|
80
|
+
:adapter => :webrick
|
81
|
+
|
82
|
+
The adapter is the server Ramaze runs to serve your application. This can be any
|
83
|
+
of mongrel/webrick/fcgi/cgi, please note that so far neither fcgi nor cgi have
|
84
|
+
received the necessary testing, but, as they are only wrappers around the
|
85
|
+
underlying Rack library, should work fine. Both fcgi and mongrel require
|
86
|
+
additional libraries to be installed, webrick and cgi run out of the box.
|
87
|
+
Generally the most supported and recommended for deployment is Mongrel.
|
88
|
+
|
89
|
+
|
90
|
+
:cache => :memory
|
91
|
+
|
92
|
+
Possible: :memory, :memcached, :yaml
|
93
|
+
The cache is one of the more important things for deployment, the default for
|
94
|
+
this is MemoryCache, a simple Hash.
|
95
|
+
What you specify here will be used by Ramaze::Cache and is used throughout
|
96
|
+
Ramaze to cache various things, like sessions, page- and value-caching.
|
97
|
+
Included in Ramaze are the MemoryCache and YAMLStoreCache, after you install
|
98
|
+
'memcached' you can also use the much more performant MemcachedCache that also
|
99
|
+
makes it easy to use the same cache between different applications (sharing
|
100
|
+
sessions is one of the most obvious uses).
|
101
|
+
|
102
|
+
|
103
|
+
:cache_all => false
|
104
|
+
|
105
|
+
Setting this value to true would enable caching for all pages served from the
|
106
|
+
Controller (all actions).
|
107
|
+
This is a very powerful setting and you might want to enable it if all pages
|
108
|
+
you serve are only built once and have no further dynamics, the key for this
|
109
|
+
cache consists of the controller and parameters, when repeated requests are
|
110
|
+
made it will always serve the same (now static) page.
|
111
|
+
|
112
|
+
|
113
|
+
:sessions => true
|
114
|
+
|
115
|
+
Enables creation of sessions and automatic creation/setting of cookies.
|
116
|
+
Please note that many functionalities of Ramaze depend on an intact session and
|
117
|
+
you will have to be careful not to use these.
|
118
|
+
This is most likely useful in combination with `cache_all`
|
119
|
+
|
120
|
+
|
121
|
+
:error_page => true
|
122
|
+
|
123
|
+
Enables the default Error page of Ramaze which is mostly useful for manual
|
124
|
+
testing and faster debugging. In most deployment-scenarios you will however
|
125
|
+
want to use your own Error page and so you can safely disable this setting.
|
126
|
+
|
127
|
+
:host => '0.0.0.0'
|
128
|
+
|
129
|
+
Tell the adapter where it accepts requests from, 0.0.0.0 says that every
|
130
|
+
IP will be accepted, 127.0.0.1 would accept only requests from loopback.
|
131
|
+
|
132
|
+
|
133
|
+
:mapping => {}
|
134
|
+
|
135
|
+
This is a very central and special setting, it contains key/value pairs
|
136
|
+
that define routes to your controllers, the keys are simple strings and
|
137
|
+
start with '/', which means http://yourhost.com/ - '/foo/bar' would point
|
138
|
+
to http://yourhost.com/foo/bar.
|
139
|
+
The value is the class of your controller.
|
140
|
+
|
141
|
+
|
142
|
+
:port => 7000
|
143
|
+
|
144
|
+
The port Ramaze runs on, if you can think of more information about this feel
|
145
|
+
free to tell us.
|
146
|
+
|
147
|
+
|
148
|
+
:run_loose => false
|
149
|
+
|
150
|
+
This option is mostly used to run the specs, it means that Ramaze will not
|
151
|
+
join the adapter-threads and therefor you are free to run any code you want
|
152
|
+
afterwards. You won't have to use this in most cases, example usage is in
|
153
|
+
spec/spec_helper.
|
154
|
+
|
155
|
+
|
156
|
+
:template_root => 'template'
|
157
|
+
|
158
|
+
The template_root is the point your templates are located relative to the
|
159
|
+
location of the entry-file (usually start.rb)
|
160
|
+
It is also worth to mention that inside this directory the `mapping` is used
|
161
|
+
to locate templates for each controller, only the controller mapped to '/' uses
|
162
|
+
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.
|