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,141 @@
|
|
1
|
+
/*#############################################################
|
2
|
+
* Name: Light
|
3
|
+
* Date: 2006-08-20
|
4
|
+
* Description: Bright and smooth.
|
5
|
+
* Author: Viktor Persson
|
6
|
+
* URL: http://templates.arcsin.se
|
7
|
+
*
|
8
|
+
* Feel free to use and modify but please provide credits.
|
9
|
+
* #############################################################*/
|
10
|
+
|
11
|
+
/* standard elements */
|
12
|
+
{
|
13
|
+
margin: 0;
|
14
|
+
padding: 0;
|
15
|
+
}
|
16
|
+
a {
|
17
|
+
color: #567;
|
18
|
+
}
|
19
|
+
a:hover {
|
20
|
+
color: #28E;
|
21
|
+
}
|
22
|
+
body {
|
23
|
+
background: #F2F2F2 url(/media/bg.gif) repeat-y center top;
|
24
|
+
color: #555A60;
|
25
|
+
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
|
26
|
+
margin: 0;
|
27
|
+
}
|
28
|
+
p,cite,code,ul {
|
29
|
+
font-size: 1.0em;
|
30
|
+
padding-bottom: 1.2em;
|
31
|
+
}
|
32
|
+
h1 {
|
33
|
+
font-size: 1.4em;
|
34
|
+
margin-bottom: 4px;
|
35
|
+
}
|
36
|
+
li {
|
37
|
+
list-style: url(/media/li.gif);
|
38
|
+
margin-left: 18px;
|
39
|
+
}
|
40
|
+
code {
|
41
|
+
background: url(/media/bgcode.gif);
|
42
|
+
border: 1px solid #F6F6F6;
|
43
|
+
color: #666;
|
44
|
+
display: block;
|
45
|
+
font: normal 1.1em "Lucida Sans Unicode",serif;
|
46
|
+
margin-bottom: 12px;
|
47
|
+
padding: 8px 10px;
|
48
|
+
white-space: pre;
|
49
|
+
}
|
50
|
+
cite {
|
51
|
+
background: url(/media/quote.gif) no-repeat;
|
52
|
+
color: #456;
|
53
|
+
display: block;
|
54
|
+
font: normal 1.4em "Lucida Sans Unicode",serif;
|
55
|
+
padding-left: 28px;
|
56
|
+
}
|
57
|
+
h1,h2,h3 {
|
58
|
+
color: #579;
|
59
|
+
padding-top: 6px;
|
60
|
+
}
|
61
|
+
*
|
62
|
+
/* misc */
|
63
|
+
.clearer {
|
64
|
+
clear: both;
|
65
|
+
}
|
66
|
+
|
67
|
+
/* structure */
|
68
|
+
.container {
|
69
|
+
margin: 0 auto;
|
70
|
+
width: 730px;
|
71
|
+
}
|
72
|
+
|
73
|
+
/* title */
|
74
|
+
.title {
|
75
|
+
float: left;
|
76
|
+
margin-top: 22px;
|
77
|
+
text-align: center;
|
78
|
+
width: 220px;
|
79
|
+
}
|
80
|
+
.title h1 {
|
81
|
+
font: normal 2em Verdana,sans-serif;
|
82
|
+
}
|
83
|
+
.title h2 {
|
84
|
+
color: #999;
|
85
|
+
font: normal 1.1em Verdana,sans-serif;
|
86
|
+
}
|
87
|
+
|
88
|
+
/* navigation */
|
89
|
+
.navigation {
|
90
|
+
background: url(/media/holder.jpg) no-repeat;
|
91
|
+
height: 100px;
|
92
|
+
padding: 0 16px;
|
93
|
+
}
|
94
|
+
.navigation a {
|
95
|
+
border-left: 1px solid #DDD;
|
96
|
+
border-right: 1px solid #FFF;
|
97
|
+
color: #89A;
|
98
|
+
float: right;
|
99
|
+
font: bold 1.2em "Trebuchet MS",sans-serif;
|
100
|
+
margin-top: 9px;
|
101
|
+
padding: 58px 18px 8px;
|
102
|
+
text-align: center;
|
103
|
+
text-decoration: none;
|
104
|
+
}
|
105
|
+
.navigation a:hover {
|
106
|
+
background: #FFF url(/media/navhover.gif) repeat-x;
|
107
|
+
color: #28E;
|
108
|
+
padding: 56px 18px 10px;
|
109
|
+
}
|
110
|
+
|
111
|
+
/* holders */
|
112
|
+
.holder {
|
113
|
+
background: url(/media/bgholder.jpg) repeat-y;
|
114
|
+
padding: 0 32px;
|
115
|
+
}
|
116
|
+
.holder_top,.footer {
|
117
|
+
clear: both;
|
118
|
+
background: url(/media/holder.jpg) no-repeat;
|
119
|
+
height: 40px;
|
120
|
+
}
|
121
|
+
|
122
|
+
/* footer */
|
123
|
+
.footer {
|
124
|
+
background-position: left bottom;
|
125
|
+
color: #666;
|
126
|
+
font-size: 1.1em;
|
127
|
+
text-align: center;
|
128
|
+
}
|
129
|
+
|
130
|
+
form {
|
131
|
+
text-align: right;
|
132
|
+
}
|
133
|
+
|
134
|
+
form input {
|
135
|
+
width: 95%;
|
136
|
+
}
|
137
|
+
|
138
|
+
form textarea {
|
139
|
+
width: 95%;
|
140
|
+
height: 30em;
|
141
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
|
6
|
+
class TCDispatcherController < Ramaze::Controller
|
7
|
+
map '/'
|
8
|
+
|
9
|
+
def index
|
10
|
+
"Hello, World!"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "Dispatcher" do
|
15
|
+
behaves_like 'http'
|
16
|
+
ramaze :ignore => ['/favicon.ico', '/robots.txt'],
|
17
|
+
:ignore_body => 'File not found'
|
18
|
+
|
19
|
+
it 'should resolve a normal request' do
|
20
|
+
page = get('/')
|
21
|
+
page.status.should == 200
|
22
|
+
page.body.should == 'Hello, World!'
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should ignore /foo.ico' do
|
26
|
+
Ramaze::Global.ignore = ['/foo.ico']
|
27
|
+
page = get('/foo.ico')
|
28
|
+
page.status.should == 404
|
29
|
+
page.body.should == 'File not found'
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
|
6
|
+
class TCElementController < Ramaze::Controller
|
7
|
+
engine :Ezamar
|
8
|
+
|
9
|
+
def index
|
10
|
+
"The index"
|
11
|
+
end
|
12
|
+
|
13
|
+
def elementy
|
14
|
+
"<Page>#{index}</Page>"
|
15
|
+
end
|
16
|
+
|
17
|
+
def nested
|
18
|
+
"<Page> some stuff <Page>#{index}</Page> more stuff </Page>"
|
19
|
+
end
|
20
|
+
|
21
|
+
def with_params(*params)
|
22
|
+
hash = Hash[*params.flatten].map{|k,v| %{#{k}="#{v}"}}.join(' ')
|
23
|
+
%{<PageWithParams #{hash}></PageWithParams>}
|
24
|
+
end
|
25
|
+
|
26
|
+
def little
|
27
|
+
%{<PageLittle />}
|
28
|
+
end
|
29
|
+
|
30
|
+
def little_params(*params)
|
31
|
+
hash = Hash[*params.flatten].map{|k,v| %{#{k}="#{v}"}}.join(' ')
|
32
|
+
%{<PageLittleWithParams #{hash} />}
|
33
|
+
end
|
34
|
+
|
35
|
+
def templating(times)
|
36
|
+
%{<PageWithTemplating times="#{times}" />}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class Page < Ezamar::Element
|
41
|
+
def render
|
42
|
+
%{ <wrap> #{content} </wrap> }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
class PageWithParams < Ezamar::Element
|
48
|
+
def render
|
49
|
+
ivs = (instance_variables - ['@content', :@content])
|
50
|
+
ivs.inject({}){|s,v| s.merge(v.to_s => instance_variable_get(v)) }.inspect
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class PageLittle < Ezamar::Element
|
55
|
+
def render
|
56
|
+
"little"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class PageLittleWithParams < Ezamar::Element
|
61
|
+
def render
|
62
|
+
ivs = (instance_variables - ['@content', :@content])
|
63
|
+
ivs.inject({}){|s,v| s.merge(v.to_s => instance_variable_get(v)) }.inspect
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class PageWithTemplating < Ezamar::Element
|
68
|
+
def render
|
69
|
+
(1..@times).to_a.join(', ')
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "Element" do
|
74
|
+
ramaze(:mapping => {'/' => TCElementController})
|
75
|
+
|
76
|
+
def retrieve(*url)
|
77
|
+
Ramaze::Controller.handle(*url).strip
|
78
|
+
end
|
79
|
+
|
80
|
+
it "simple request" do
|
81
|
+
retrieve('/').should == "The index"
|
82
|
+
end
|
83
|
+
|
84
|
+
it "with element" do
|
85
|
+
retrieve('/elementy').should == "<wrap> The index </wrap>"
|
86
|
+
end
|
87
|
+
|
88
|
+
it "nested element" do
|
89
|
+
retrieve('/nested').should == "<wrap> some stuff <wrap> The index </wrap> more stuff </wrap>"
|
90
|
+
end
|
91
|
+
|
92
|
+
it "with_params" do
|
93
|
+
retrieve('/with_params/one/two').should == {'@one' => 'two'}.inspect
|
94
|
+
end
|
95
|
+
|
96
|
+
it "little" do
|
97
|
+
retrieve('/little').should == 'little'
|
98
|
+
end
|
99
|
+
|
100
|
+
it "little params" do
|
101
|
+
retrieve('/little_params/one/eins').should == {'@one' => 'eins'}.inspect
|
102
|
+
end
|
103
|
+
|
104
|
+
it "templating" do
|
105
|
+
retrieve('/templating/10').should == (1..10).to_a.join(', ')
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
require 'open-uri'
|
6
|
+
|
7
|
+
class TCErrorController < Ramaze::Controller
|
8
|
+
map :/
|
9
|
+
|
10
|
+
def index
|
11
|
+
self.class.name
|
12
|
+
end
|
13
|
+
|
14
|
+
def erroring
|
15
|
+
blah
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class TCErrorCustomController < Ramaze::Controller
|
20
|
+
map "/custom"
|
21
|
+
|
22
|
+
def error
|
23
|
+
"The error page of custom"
|
24
|
+
end
|
25
|
+
|
26
|
+
def erroring
|
27
|
+
bluh
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "Error" do
|
32
|
+
behaves_like 'http'
|
33
|
+
ramaze :error_page => true,
|
34
|
+
:view_root => 'spec/ramaze/public'
|
35
|
+
|
36
|
+
@handle_error = Ramaze::Dispatcher::Error::HANDLE_ERROR
|
37
|
+
@orig_handle_error = @handle_error.dup
|
38
|
+
|
39
|
+
before do
|
40
|
+
Ramaze::Cache.resolved.clear
|
41
|
+
Ramaze::Cache.patterns.clear
|
42
|
+
@handle_error.clear
|
43
|
+
@handle_error.merge!(@orig_handle_error)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should resolve custom error pages per controller' do
|
47
|
+
response = get("/custom/does_not_exist")
|
48
|
+
response.status.should == 404
|
49
|
+
response.body.should == "The error page of custom"
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'should throw errors from rendering' do
|
53
|
+
response = get('/erroring')
|
54
|
+
response.status.should == 500
|
55
|
+
regex = %r(undefined local variable or method `blah' for .*?TCErrorController)
|
56
|
+
response.body.should =~ regex
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should throw errors from rendering' do
|
60
|
+
response = get('/custom/erroring')
|
61
|
+
response.status.should == 500
|
62
|
+
response.body.should == "The error page of custom"
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'should give 404 when no action is found' do
|
66
|
+
response = get('/foobar')
|
67
|
+
response.status.should == 404
|
68
|
+
response.body.should =~ %r(No Action found for `/foobar' on TCErrorController)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should give custom status when no action is found" do
|
72
|
+
@handle_error[Ramaze::Error::NoAction] = [707, '/error']
|
73
|
+
|
74
|
+
response = get('/illegal1')
|
75
|
+
response.status.should == 707
|
76
|
+
response.body.should =~ %r(No Action found for `/illegal1' on TCErrorController)
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should give 404 when no controller is found" do
|
80
|
+
old_mapping = Ramaze::Global.mapping.dup
|
81
|
+
Ramaze::Global.mapping.clear
|
82
|
+
response = get('/illegal2')
|
83
|
+
response.status.should == 404
|
84
|
+
response.body.should =~ %r(No Controller found for `/error')
|
85
|
+
Ramaze::Global.mapping = old_mapping
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should return custom error page" do
|
89
|
+
@handle_error[Ramaze::Error::NoAction] = [404, '/error404']
|
90
|
+
response = get('/illegal3')
|
91
|
+
response.status.should == 404
|
92
|
+
response.body.should == '404 - not found'
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
|
6
|
+
spec_require 'ramaze/gestalt'
|
7
|
+
|
8
|
+
describe "Gestalt" do
|
9
|
+
# This is useful for any controller using Gestalt,
|
10
|
+
# should be made a MixIn somewhen.
|
11
|
+
def gestalt &block
|
12
|
+
Ramaze::Gestalt.new(&block).to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
it "simple tag" do
|
16
|
+
gestalt{ br }.should == '<br />'
|
17
|
+
gestalt{ p }.should == '<p />'
|
18
|
+
end
|
19
|
+
|
20
|
+
it "open close tags" do
|
21
|
+
gestalt{ p{} }.should == '<p></p>'
|
22
|
+
gestalt{ div{} }.should == '<div></div>'
|
23
|
+
end
|
24
|
+
|
25
|
+
it "nested tags" do
|
26
|
+
gestalt{ p{ br } }.should == '<p><br /></p>'
|
27
|
+
end
|
28
|
+
|
29
|
+
it "deep nested tags" do
|
30
|
+
gestalt{ p do
|
31
|
+
div do
|
32
|
+
ol do
|
33
|
+
li
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
}.should == '<p><div><ol><li /></ol></div></p>'
|
38
|
+
end
|
39
|
+
|
40
|
+
it "deep nested tags with repetition" do
|
41
|
+
gestalt{ p do
|
42
|
+
div do
|
43
|
+
ol do
|
44
|
+
li
|
45
|
+
li
|
46
|
+
end
|
47
|
+
ol do
|
48
|
+
li
|
49
|
+
li
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
}.should == '<p><div><ol><li /><li /></ol><ol><li /><li /></ol></div></p>'
|
54
|
+
end
|
55
|
+
|
56
|
+
it "deep nested tags with strings" do
|
57
|
+
gestalt{
|
58
|
+
p do
|
59
|
+
div do
|
60
|
+
'Hello, World'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
}.should == '<p><div>Hello, World</div></p>'
|
64
|
+
end
|
65
|
+
|
66
|
+
it "some simple example" do
|
67
|
+
gestalt{
|
68
|
+
html do
|
69
|
+
head do
|
70
|
+
title do
|
71
|
+
"Hello World"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
body do
|
75
|
+
h1 do
|
76
|
+
"Hello World"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
}.should == '<html><head><title>Hello World</title></head><body><h1>Hello World</h1></body></html>'
|
81
|
+
end
|
82
|
+
|
83
|
+
it "now some ruby inside" do
|
84
|
+
gestalt{
|
85
|
+
table do
|
86
|
+
tr do
|
87
|
+
%w[one two three].each do |s|
|
88
|
+
td{s}
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
}.should == '<table><tr><td>one</td><td>two</td><td>three</td></tr></table>'
|
93
|
+
end
|
94
|
+
|
95
|
+
it "children as parameters" do
|
96
|
+
gestalt {
|
97
|
+
a "Hello"
|
98
|
+
b(23, 5) { "1" }
|
99
|
+
c(42) {
|
100
|
+
d
|
101
|
+
}
|
102
|
+
e("f & g")
|
103
|
+
}.should == '<a>Hello</a><b>2351</b><c>42<d /></c><e>f & g</e>'
|
104
|
+
end
|
105
|
+
|
106
|
+
it "escapeable attributes" do
|
107
|
+
gestalt {
|
108
|
+
a(:href => "http://example.org/?a=one&b=two") {
|
109
|
+
"Click here"
|
110
|
+
}
|
111
|
+
}.should == '<a href="http://example.org/?a=one&b=two">Click here</a>'
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'should accept symbols as attributes' do
|
115
|
+
input = gestalt{ input(:type => :text, :value => :one) }
|
116
|
+
|
117
|
+
input.should =~ /type="text"/
|
118
|
+
input.should =~ /value="one"/
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'tags with prefix' do
|
122
|
+
gestalt{tag "prefix:local"}.should == '<prefix:local />'
|
123
|
+
end
|
124
|
+
|
125
|
+
it 'tags with a variety of characters' do
|
126
|
+
# with "-"
|
127
|
+
gestalt{tag "hello-world"}.should == '<hello-world />'
|
128
|
+
# with Hiragana
|
129
|
+
gestalt{tag "あいうえお"}.should == '<あいうえお />'
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
|
6
|
+
class TCAspectController < Ramaze::Controller
|
7
|
+
map '/'
|
8
|
+
trait :foo => :bar
|
9
|
+
helper :aspect
|
10
|
+
|
11
|
+
def test_before() $helper_aspect_spec_test_before += 2 end
|
12
|
+
before(:test_before){ $helper_aspect_spec_test_before = 40 }
|
13
|
+
|
14
|
+
def test_after() $helper_aspect_spec_test_after = 40 end
|
15
|
+
after(:test_after){ $helper_aspect_spec_test_after += 2 }
|
16
|
+
|
17
|
+
def test_wrap() end
|
18
|
+
wrap(:test_wrap){ $helper_aspect_spec_test_wrap ||= 0; $helper_aspect_spec_test_wrap += 21 }
|
19
|
+
|
20
|
+
wrap(:test_template) { '<aspect>' }
|
21
|
+
end
|
22
|
+
|
23
|
+
class TCAspectAllController < Ramaze::Controller
|
24
|
+
map '/all'
|
25
|
+
|
26
|
+
helper :aspect
|
27
|
+
view_root __DIR__/:view
|
28
|
+
|
29
|
+
def test_all_first() 'first' end
|
30
|
+
def test_all_second() 'second' end
|
31
|
+
|
32
|
+
before_all{ $helper_aspect_spec_all = 40 }
|
33
|
+
after_all{ $helper_aspect_spec_all += 2 }
|
34
|
+
|
35
|
+
def test_all_after() 'after' end
|
36
|
+
|
37
|
+
def layout() '<div>#@content</div>' end
|
38
|
+
template :loop_with_layout, :loop
|
39
|
+
layout :layout => [:loop_with_layout]
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "AspectHelper" do
|
43
|
+
behaves_like 'http'
|
44
|
+
ramaze :error_page => false
|
45
|
+
|
46
|
+
it "shouldn't overwrite traits on inclusion" do
|
47
|
+
TCAspectController.trait[:foo].should == :bar
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should use before' do
|
51
|
+
$helper_aspect_spec_test_before = nil
|
52
|
+
get('/test_before')
|
53
|
+
$helper_aspect_spec_test_before.should == 42
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should use after' do
|
57
|
+
$helper_aspect_spec_test_after = nil
|
58
|
+
get('/test_after')
|
59
|
+
$helper_aspect_spec_test_after.should == 42
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'should use wrap' do
|
63
|
+
$helper_aspect_spec_test_wrap = nil
|
64
|
+
get('/test_wrap')
|
65
|
+
$helper_aspect_spec_test_wrap.should == 42
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'should before_all and after_all' do
|
69
|
+
$helper_aspect_spec_all = nil
|
70
|
+
get('/all/test_all_first')
|
71
|
+
$helper_aspect_spec_all.should == 42
|
72
|
+
|
73
|
+
$helper_aspect_spec_all = nil
|
74
|
+
get('/all/test_all_second')
|
75
|
+
$helper_aspect_spec_all.should == 42
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'should before_all and after_all for templates' do
|
79
|
+
$helper_aspect_spec_all = nil
|
80
|
+
get('/all/test_template')
|
81
|
+
$helper_aspect_spec_all.should == 42
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'should before_all and after_all for all defined actions' do
|
85
|
+
$helper_aspect_spec_all = nil
|
86
|
+
get('/all/test_all_after')
|
87
|
+
$helper_aspect_spec_all.should == 42
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should not apply aspects to render_template' do
|
91
|
+
$helper_aspect_spec_all = nil
|
92
|
+
get('/all/loop').body.gsub(/\s/,'').should == '12345'
|
93
|
+
$helper_aspect_spec_all.should == 42
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'should not apply aspects to layouts' do
|
97
|
+
$helper_aspect_spec_all = nil
|
98
|
+
get('/all/loop_with_layout').body.gsub(/\s/,'').should == '<div>12345</div>'
|
99
|
+
$helper_aspect_spec_all.should == 42
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'spec/helper'
|
5
|
+
|
6
|
+
class TCAuthHelperController < Ramaze::Controller
|
7
|
+
map '/'
|
8
|
+
helper :auth
|
9
|
+
|
10
|
+
def index
|
11
|
+
self.class.name
|
12
|
+
end
|
13
|
+
|
14
|
+
def session_inspect
|
15
|
+
session.inspect
|
16
|
+
end
|
17
|
+
|
18
|
+
def secured
|
19
|
+
"Secret content"
|
20
|
+
end
|
21
|
+
before(:secured){ login_required }
|
22
|
+
end
|
23
|
+
|
24
|
+
class TCAuthHashHelperController < TCAuthHelperController
|
25
|
+
map '/hash'
|
26
|
+
trait :auth_table => {
|
27
|
+
'manveru' => '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
class TCAuthMethodHelperController < TCAuthHelperController
|
32
|
+
map '/method'
|
33
|
+
trait :auth_table => :auth_table
|
34
|
+
|
35
|
+
def auth_table
|
36
|
+
{ 'manveru' => '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class TCAuthLambdaHelperController < TCAuthHelperController
|
41
|
+
map '/lambda'
|
42
|
+
trait :auth_table => lambda{
|
43
|
+
{ 'manveru' => '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8' }
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "StackHelper" do
|
48
|
+
behaves_like 'browser'
|
49
|
+
|
50
|
+
ramaze :adapter => :webrick
|
51
|
+
[ TCAuthHashHelperController,
|
52
|
+
TCAuthMethodHelperController,
|
53
|
+
TCAuthLambdaHelperController
|
54
|
+
].each do |controller|
|
55
|
+
|
56
|
+
it controller.to_s do
|
57
|
+
Browser.new(Ramaze::Global.mapping.invert[controller]) do
|
58
|
+
get('/secured').should == ''
|
59
|
+
post('/login', 'username' => 'manveru', 'password' => 'password')
|
60
|
+
get('/secured').should == 'Secret content'
|
61
|
+
get('/logout')
|
62
|
+
get('/secured').should == ''
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|