rjspotter-ramaze 2009.06.29
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/.gitignore +3 -0
- data/.mailmap +25 -0
- data/MANIFEST +502 -0
- data/README.md +457 -0
- data/Rakefile +88 -0
- data/benchmark/bench_templates/bench.rb +67 -0
- data/benchmark/bench_templates/view/large.erb +79 -0
- data/benchmark/bench_templates/view/large.haml +41 -0
- data/benchmark/bench_templates/view/large.xhtml +79 -0
- data/benchmark/bench_templates/view/small.erb +21 -0
- data/benchmark/bench_templates/view/small.haml +12 -0
- data/benchmark/bench_templates/view/small.xhtml +21 -0
- data/benchmark/results.txt +131 -0
- data/benchmark/run.rb +355 -0
- data/benchmark/suite/minimal.rb +11 -0
- data/benchmark/suite/no_informer.rb +7 -0
- data/benchmark/suite/no_sessions.rb +9 -0
- data/benchmark/suite/no_template.rb +7 -0
- data/benchmark/suite/simple.rb +5 -0
- data/benchmark/suite/template_erubis.rb +8 -0
- data/benchmark/suite/template_etanni.rb +8 -0
- data/benchmark/suite/template_ezamar.rb +8 -0
- data/benchmark/suite/template_haml.rb +13 -0
- data/benchmark/suite/template_liquid.rb +11 -0
- data/benchmark/suite/template_markaby.rb +9 -0
- data/benchmark/suite/template_nagoro.rb +8 -0
- data/benchmark/suite/template_redcloth.rb +13 -0
- data/benchmark/suite/template_tenjin.rb +8 -0
- data/benchmark/test.rb +35 -0
- data/bin/ramaze +15 -0
- data/doc/AUTHORS +44 -0
- data/doc/CHANGELOG +17362 -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 +146 -0
- data/doc/meta/configuration.txt +163 -0
- data/doc/meta/internals.txt +278 -0
- data/doc/meta/users.kml +64 -0
- data/doc/tutorial/todolist.html +1379 -0
- data/doc/tutorial/todolist.txt +920 -0
- data/examples/app/auth/layout/auth.xhtml +25 -0
- data/examples/app/auth/start.rb +23 -0
- data/examples/app/auth/view/index.xhtml +4 -0
- data/examples/app/auth/view/login.xhtml +20 -0
- data/examples/app/auth/view/secret.xhtml +1 -0
- data/examples/app/blog/README +3 -0
- data/examples/app/blog/app.rb +69 -0
- data/examples/app/blog/config.ru +17 -0
- data/examples/app/blog/controller/comment.rb +45 -0
- data/examples/app/blog/controller/entry.rb +85 -0
- data/examples/app/blog/controller/init.rb +86 -0
- data/examples/app/blog/controller/main.rb +20 -0
- data/examples/app/blog/controller/tag.rb +9 -0
- data/examples/app/blog/layout/default.nag +31 -0
- data/examples/app/blog/model/comment.rb +58 -0
- data/examples/app/blog/model/entry.rb +89 -0
- data/examples/app/blog/model/init.rb +15 -0
- data/examples/app/blog/model/tag.rb +36 -0
- data/examples/app/blog/public/css/screen.css +273 -0
- data/examples/app/blog/spec/blog.rb +87 -0
- data/examples/app/blog/start.rb +5 -0
- data/examples/app/blog/view/comment/form.nag +10 -0
- data/examples/app/blog/view/comment/show.nag +16 -0
- data/examples/app/blog/view/entry/edit.nag +14 -0
- data/examples/app/blog/view/entry/feed.atom.nag +8 -0
- data/examples/app/blog/view/entry/feed.rss.nag +7 -0
- data/examples/app/blog/view/entry/index.nag +7 -0
- data/examples/app/blog/view/entry/new.nag +13 -0
- data/examples/app/blog/view/entry/show.nag +36 -0
- data/examples/app/blog/view/feed.atom.nag +18 -0
- data/examples/app/blog/view/feed.rss.nag +25 -0
- data/examples/app/blog/view/index.nag +6 -0
- data/examples/app/blog/view/tag/index.nag +5 -0
- data/examples/app/chat/layout/default.xhtml +13 -0
- data/examples/app/chat/model/history.rb +38 -0
- data/examples/app/chat/model/message.rb +7 -0
- data/examples/app/chat/public/css/chat.css +9 -0
- data/examples/app/chat/public/js/chat.js +28 -0
- data/examples/app/chat/public/js/jquery.js +3436 -0
- data/examples/app/chat/start.rb +39 -0
- data/examples/app/chat/view/chat.xhtml +9 -0
- data/examples/app/chat/view/index.xhtml +7 -0
- data/examples/app/localization/locale/de.yaml +5 -0
- data/examples/app/localization/locale/en.yaml +5 -0
- data/examples/app/localization/locale/ja.yaml +5 -0
- data/examples/app/localization/start.rb +48 -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/start.rb +79 -0
- data/examples/app/sourceview/view/index.haml +59 -0
- data/examples/app/todolist/controller/init.rb +10 -0
- data/examples/app/todolist/controller/task.rb +39 -0
- data/examples/app/todolist/layout/default.xhtml +14 -0
- data/examples/app/todolist/model/init.rb +14 -0
- data/examples/app/todolist/model/task.rb +39 -0
- data/examples/app/todolist/public/css/screen.css +63 -0
- data/examples/app/todolist/public/favicon.ico +0 -0
- data/examples/app/todolist/start.rb +11 -0
- data/examples/app/todolist/view/index.xhtml +29 -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 +109 -0
- data/examples/app/wikore/src/controller.rb +78 -0
- data/examples/app/wikore/src/model.rb +56 -0
- data/examples/app/wikore/start.rb +9 -0
- data/examples/app/wikore/view/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 +47 -0
- data/examples/basic/gestalt.rb +26 -0
- data/examples/basic/hello.rb +14 -0
- data/examples/basic/layout.rb +28 -0
- data/examples/basic/linking.rb +29 -0
- data/examples/basic/partial.rb +26 -0
- data/examples/basic/simple.rb +52 -0
- data/examples/helpers/cache.rb +33 -0
- data/examples/helpers/form_with_sequel.rb +24 -0
- data/examples/helpers/httpdigest.rb +107 -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/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 +37 -0
- data/examples/misc/nagoro_element.rb +43 -0
- data/examples/misc/ramaise.rb +132 -0
- data/examples/misc/rapp.rb +56 -0
- data/examples/misc/sequel_scaffolding.rb +34 -0
- data/examples/misc/serve_directory.rb +6 -0
- data/examples/templates/template_erubis.rb +52 -0
- data/examples/templates/template_ezamar.rb +51 -0
- data/examples/templates/template_haml.rb +49 -0
- data/examples/templates/template_liquid.rb +66 -0
- data/examples/templates/template_markaby.rb +57 -0
- data/examples/templates/template_nagoro.rb +50 -0
- data/examples/templates/template_redcloth.rb +58 -0
- data/examples/templates/template_remarkably.rb +54 -0
- data/examples/templates/template_tenjin.rb +52 -0
- data/examples/templates/view/external.haml +22 -0
- data/examples/templates/view/external.liquid +28 -0
- data/examples/templates/view/external.mab +30 -0
- data/examples/templates/view/external.nag +28 -0
- data/examples/templates/view/external.redcloth +19 -0
- data/examples/templates/view/external.rem +30 -0
- data/examples/templates/view/external.rhtml +28 -0
- data/examples/templates/view/external.tenjin +28 -0
- data/examples/templates/view/external.zmr +28 -0
- data/lib/proto/app.rb +14 -0
- data/lib/proto/config.ru +20 -0
- data/lib/proto/controller/init.rb +11 -0
- data/lib/proto/controller/main.rb +20 -0
- data/lib/proto/layout/default.xhtml +24 -0
- data/lib/proto/model/init.rb +4 -0
- data/lib/proto/public/.htaccess +24 -0
- data/lib/proto/public/css/screen.css +30 -0
- data/lib/proto/public/dispatch.fcgi +11 -0
- data/lib/proto/public/favicon.ico +0 -0
- data/lib/proto/public/js/jquery.js +4376 -0
- data/lib/proto/public/ramaze.png +0 -0
- data/lib/proto/spec/main.rb +20 -0
- data/lib/proto/start.rb +8 -0
- data/lib/proto/view/index.xhtml +41 -0
- data/lib/ramaze.rb +87 -0
- data/lib/ramaze/app.rb +124 -0
- data/lib/ramaze/cache.rb +19 -0
- data/lib/ramaze/cache/localmemcache.rb +56 -0
- data/lib/ramaze/cache/memcache.rb +124 -0
- data/lib/ramaze/cache/sequel.rb +82 -0
- data/lib/ramaze/contrib/addressable_route.rb +55 -0
- data/lib/ramaze/contrib/app_graph.rb +64 -0
- data/lib/ramaze/contrib/email.rb +88 -0
- data/lib/ramaze/contrib/facebook.rb +23 -0
- data/lib/ramaze/contrib/facebook/facebook.rb +171 -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 +1 -0
- data/lib/ramaze/contrib/maruku_uv.rb +59 -0
- data/lib/ramaze/contrib/profiling.rb +36 -0
- data/lib/ramaze/contrib/rest.rb +22 -0
- data/lib/ramaze/contrib/sequel/create_join.rb +26 -0
- data/lib/ramaze/contrib/sequel/form_field.rb +129 -0
- data/lib/ramaze/contrib/sequel/image.rb +196 -0
- data/lib/ramaze/contrib/sequel/relation.rb +98 -0
- data/lib/ramaze/controller.rb +104 -0
- data/lib/ramaze/controller/default.rb +12 -0
- data/lib/ramaze/current.rb +7 -0
- data/lib/ramaze/files.rb +24 -0
- data/lib/ramaze/gestalt.rb +132 -0
- data/lib/ramaze/helper.rb +13 -0
- data/lib/ramaze/helper/auth.rb +84 -0
- data/lib/ramaze/helper/bench.rb +41 -0
- data/lib/ramaze/helper/cache.rb +117 -0
- data/lib/ramaze/helper/disqus.rb +26 -0
- data/lib/ramaze/helper/flash.rb +62 -0
- data/lib/ramaze/helper/form.rb +127 -0
- data/lib/ramaze/helper/formatting.rb +189 -0
- data/lib/ramaze/helper/gestalt.rb +47 -0
- data/lib/ramaze/helper/gravatar.rb +79 -0
- data/lib/ramaze/helper/httpdigest.rb +97 -0
- data/lib/ramaze/helper/identity.rb +119 -0
- data/lib/ramaze/helper/layout.rb +97 -0
- data/lib/ramaze/helper/link.rb +56 -0
- data/lib/ramaze/helper/localize.rb +138 -0
- data/lib/ramaze/helper/markaby.rb +31 -0
- data/lib/ramaze/helper/maruku.rb +16 -0
- data/lib/ramaze/helper/nitroform.rb +14 -0
- data/lib/ramaze/helper/pager.rb +367 -0
- data/lib/ramaze/helper/paginate.rb +242 -0
- data/lib/ramaze/helper/partial.rb +100 -0
- data/lib/ramaze/helper/remarkably.rb +14 -0
- data/lib/ramaze/helper/request_accessor.rb +16 -0
- data/lib/ramaze/helper/sequel.rb +55 -0
- data/lib/ramaze/helper/sequel_form.rb +284 -0
- data/lib/ramaze/helper/simple_captcha.rb +61 -0
- data/lib/ramaze/helper/stack.rb +75 -0
- data/lib/ramaze/helper/tagz.rb +19 -0
- data/lib/ramaze/helper/thread.rb +17 -0
- data/lib/ramaze/helper/ultraviolet.rb +46 -0
- data/lib/ramaze/helper/user.rb +229 -0
- data/lib/ramaze/helper/xhtml.rb +34 -0
- data/lib/ramaze/log.rb +39 -0
- data/lib/ramaze/log/analogger.rb +39 -0
- data/lib/ramaze/log/growl.rb +38 -0
- data/lib/ramaze/log/hub.rb +41 -0
- data/lib/ramaze/log/informer.rb +129 -0
- data/lib/ramaze/log/knotify.rb +28 -0
- data/lib/ramaze/log/logger.rb +26 -0
- data/lib/ramaze/log/logging.rb +83 -0
- data/lib/ramaze/log/rotatinginformer.rb +168 -0
- data/lib/ramaze/log/syslog.rb +51 -0
- data/lib/ramaze/log/xosd.rb +92 -0
- data/lib/ramaze/middleware_compiler.rb +13 -0
- data/lib/ramaze/plugin.rb +69 -0
- data/lib/ramaze/reloader.rb +172 -0
- data/lib/ramaze/reloader/watch_inotify.rb +85 -0
- data/lib/ramaze/reloader/watch_stat.rb +58 -0
- data/lib/ramaze/request.rb +115 -0
- data/lib/ramaze/response.rb +36 -0
- data/lib/ramaze/setup.rb +123 -0
- data/lib/ramaze/snippets.rb +22 -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/fiber.rb +63 -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/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/ordered_set.rb +51 -0
- data/lib/ramaze/snippets/proc/locals.rb +19 -0
- data/lib/ramaze/snippets/ramaze/acquire.rb +31 -0
- data/lib/ramaze/snippets/ramaze/deprecated.rb +23 -0
- data/lib/ramaze/snippets/ramaze/dictionary.rb +400 -0
- data/lib/ramaze/snippets/ramaze/fiber.rb +24 -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/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/spec.rb +33 -0
- data/lib/ramaze/spec/bacon.rb +34 -0
- data/lib/ramaze/spec/helper/bacon.rb +8 -0
- data/lib/ramaze/spec/helper/pretty_output.rb +82 -0
- data/lib/ramaze/spec/helper/snippets.rb +16 -0
- data/lib/ramaze/spec/helper/template_examples.rb +19 -0
- data/lib/ramaze/tool/bin.rb +340 -0
- data/lib/ramaze/tool/create.rb +48 -0
- data/lib/ramaze/tool/project_creator.rb +111 -0
- data/lib/ramaze/version.rb +3 -0
- data/lib/ramaze/view.rb +39 -0
- data/lib/ramaze/view/erubis.rb +23 -0
- data/lib/ramaze/view/ezamar.rb +23 -0
- data/lib/ramaze/view/gestalt.rb +14 -0
- data/lib/ramaze/view/haml.rb +16 -0
- data/lib/ramaze/view/liquid.rb +100 -0
- data/lib/ramaze/view/maruku.rb +15 -0
- data/lib/ramaze/view/nagoro.rb +44 -0
- data/lib/ramaze/view/nagoro/render_partial.rb +32 -0
- data/lib/ramaze/view/redcloth.rb +21 -0
- data/lib/ramaze/view/remarkably.rb +21 -0
- data/lib/ramaze/view/sass.rb +21 -0
- data/lib/ramaze/view/tagz.rb +63 -0
- data/lib/ramaze/view/tenjin.rb +32 -0
- data/lib/vendor/etag.rb +22 -0
- data/lib/vendor/route_exceptions.rb +42 -0
- data/ramaze.gemspec +85 -0
- data/spec/contrib/addressable_route.rb +32 -0
- data/spec/contrib/rest.rb +28 -0
- data/spec/examples/caching.rb +16 -0
- data/spec/examples/css.rb +14 -0
- data/spec/examples/element.rb +15 -0
- data/spec/examples/hello.rb +10 -0
- data/spec/examples/helpers/httpdigest.rb +64 -0
- data/spec/examples/linking.rb +17 -0
- data/spec/examples/simple.rb +40 -0
- data/spec/examples/templates/template_erubis.rb +10 -0
- data/spec/examples/templates/template_ezamar.rb +10 -0
- data/spec/examples/templates/template_haml.rb +10 -0
- data/spec/examples/templates/template_liquid.rb +10 -0
- data/spec/examples/templates/template_markaby.rb +11 -0
- data/spec/examples/templates/template_nagoro.rb +10 -0
- data/spec/examples/templates/template_redcloth.rb +10 -0
- data/spec/examples/templates/template_remarkably.rb +10 -0
- data/spec/examples/templates/template_tenjin.rb +10 -0
- data/spec/helper.rb +9 -0
- data/spec/ramaze/action/render.rb +21 -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.erb +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.erb +1 -0
- data/spec/ramaze/action/view/sub/sub_wrapper.xhtml +1 -0
- data/spec/ramaze/app.rb +47 -0
- data/spec/ramaze/bin/ramaze.rb +91 -0
- data/spec/ramaze/cache/localmemcache.rb +49 -0
- data/spec/ramaze/cache/memcache.rb +60 -0
- data/spec/ramaze/cache/sequel.rb +51 -0
- data/spec/ramaze/controller/actionless_templates.rb +36 -0
- data/spec/ramaze/controller/lonely_mapping.rb +16 -0
- data/spec/ramaze/controller/mapping.rb +43 -0
- data/spec/ramaze/controller/provide_inheritance.rb +47 -0
- data/spec/ramaze/controller/resolve.rb +30 -0
- data/spec/ramaze/controller/subclass.rb +36 -0
- data/spec/ramaze/controller/template_resolving.rb +77 -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/dispatcher/directory.rb +69 -0
- data/spec/ramaze/dispatcher/file.rb +71 -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/error.rb +88 -0
- data/spec/ramaze/files.rb +29 -0
- data/spec/ramaze/files/public_1/plain.txt +1 -0
- data/spec/ramaze/files/public_2/rich.txt +1 -0
- data/spec/ramaze/gestalt.rb +135 -0
- data/spec/ramaze/helper/auth.rb +83 -0
- data/spec/ramaze/helper/bench.rb +18 -0
- data/spec/ramaze/helper/cache.rb +124 -0
- data/spec/ramaze/helper/flash.rb +41 -0
- data/spec/ramaze/helper/form.rb +356 -0
- data/spec/ramaze/helper/formatting.rb +111 -0
- data/spec/ramaze/helper/gestalt.rb +15 -0
- data/spec/ramaze/helper/gravatar.rb +40 -0
- data/spec/ramaze/helper/httpdigest.rb +144 -0
- data/spec/ramaze/helper/layout.rb +79 -0
- data/spec/ramaze/helper/layout/default.xhtml +5 -0
- data/spec/ramaze/helper/link.rb +70 -0
- data/spec/ramaze/helper/localize.rb +62 -0
- data/spec/ramaze/helper/maruku.rb +19 -0
- data/spec/ramaze/helper/pager.rb +96 -0
- data/spec/ramaze/helper/paginate.rb +68 -0
- data/spec/ramaze/helper/request_accessor.rb +19 -0
- data/spec/ramaze/helper/sequel_form.rb +91 -0
- data/spec/ramaze/helper/simple_captcha.rb +45 -0
- data/spec/ramaze/helper/stack.rb +86 -0
- data/spec/ramaze/helper/user.rb +72 -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/helper/xhtml.rb +32 -0
- data/spec/ramaze/log/informer.rb +73 -0
- data/spec/ramaze/log/logging.rb +63 -0
- data/spec/ramaze/log/syslog.rb +73 -0
- data/spec/ramaze/params.rb +153 -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 +61 -0
- data/spec/ramaze/rewrite/file.css +1 -0
- data/spec/ramaze/session/memcache.rb +66 -0
- data/spec/ramaze/struct.rb +47 -0
- data/spec/ramaze/template/ramaze/external.test +1 -0
- data/spec/ramaze/view.rb +36 -0
- data/spec/ramaze/view/erubis.rb +73 -0
- data/spec/ramaze/view/erubis/external.rhtml +8 -0
- data/spec/ramaze/view/erubis/sum.rhtml +1 -0
- data/spec/ramaze/view/ezamar.rb +73 -0
- data/spec/ramaze/view/ezamar/external.zmr +8 -0
- data/spec/ramaze/view/ezamar/sum.zmr +1 -0
- data/spec/ramaze/view/gestalt.rb +94 -0
- data/spec/ramaze/view/gestalt/external.ges +8 -0
- data/spec/ramaze/view/haml.rb +86 -0
- data/spec/ramaze/view/haml/external.haml +5 -0
- data/spec/ramaze/view/haml/sum.haml +2 -0
- data/spec/ramaze/view/liquid.rb +73 -0
- data/spec/ramaze/view/liquid/external.liquid +8 -0
- data/spec/ramaze/view/liquid/sum.liquid +1 -0
- data/spec/ramaze/view/nagoro.rb +73 -0
- data/spec/ramaze/view/nagoro/external.nag +8 -0
- data/spec/ramaze/view/nagoro/sum.nag +1 -0
- data/spec/ramaze/view/redcloth.rb +66 -0
- data/spec/ramaze/view/redcloth/external.redcloth +8 -0
- data/spec/ramaze/view/remarkably.rb +49 -0
- data/spec/ramaze/view/remarkably/external.rem +8 -0
- data/spec/ramaze/view/remarkably/sum.rem +1 -0
- data/spec/ramaze/view/sass.rb +73 -0
- data/spec/ramaze/view/sass/file.css.sass +5 -0
- data/spec/ramaze/view/tagz.rb +51 -0
- data/spec/ramaze/view/tagz/external.tagz +8 -0
- data/spec/ramaze/view/tagz/sum.tagz +1 -0
- data/spec/ramaze/view/tenjin.rb +57 -0
- data/spec/ramaze/view/tenjin/external.rbhtml +8 -0
- data/spec/ramaze/view/tenjin/sum.rbhtml +1 -0
- data/spec/snippets/array/put_within.rb +33 -0
- data/spec/snippets/binding/locals.rb +9 -0
- data/spec/snippets/numeric/filesize_format.rb +12 -0
- data/spec/snippets/numeric/time.rb +12 -0
- data/spec/snippets/object/__dir__.rb +14 -0
- data/spec/snippets/ordered_set.rb +63 -0
- data/spec/snippets/ramaze/acquire.rb +77 -0
- data/spec/snippets/ramaze/dictionary.rb +110 -0
- data/spec/snippets/ramaze/struct.rb +12 -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 +9 -0
- data/tasks/authors.rake +30 -0
- data/tasks/bacon.rake +66 -0
- data/tasks/changelog.rake +20 -0
- data/tasks/copyright.rake +21 -0
- data/tasks/gem.rake +22 -0
- data/tasks/gem_setup.rake +99 -0
- data/tasks/git.rake +46 -0
- data/tasks/grancher.rake +12 -0
- data/tasks/jquery.rake +15 -0
- data/tasks/manifest.rake +4 -0
- data/tasks/metric_changes.rake +24 -0
- data/tasks/rcov.rake +23 -0
- data/tasks/release.rake +54 -0
- data/tasks/reversion.rake +8 -0
- data/tasks/setup.rake +6 -0
- data/tasks/todo.rake +27 -0
- data/tasks/traits.rake +21 -0
- data/tasks/yard.rake +4 -0
- metadata +720 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
module Ramaze
|
2
|
+
module Helper
|
3
|
+
# Produce very simple question/answer pairs.
|
4
|
+
#
|
5
|
+
# The default is a trivial mathematical problem.
|
6
|
+
#
|
7
|
+
# Usage (trait is optional):
|
8
|
+
#
|
9
|
+
# class RegisterController < Ramaze::Controller
|
10
|
+
# trait :captcha => lambda{
|
11
|
+
# ["the answer to everything", "42"]
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
# def index
|
15
|
+
# %(
|
16
|
+
# <form action="#{r(:answer}">
|
17
|
+
# What is #{simple_captcha}?
|
18
|
+
# <input type="text" name="answer" />"
|
19
|
+
# <input type="submit" />
|
20
|
+
# </form>
|
21
|
+
# ).strip
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# def answer
|
25
|
+
# check_captcha(request[:answer])
|
26
|
+
# end
|
27
|
+
# end
|
28
|
+
module SimpleCaptcha
|
29
|
+
include Ramaze::Traited
|
30
|
+
|
31
|
+
NUMBERS = [5, 10, 15, 20]
|
32
|
+
|
33
|
+
# lambda should return question and answer in [question, answer] form
|
34
|
+
trait :captcha => lambda{
|
35
|
+
ns = Array.new(2){ NUMBERS.sort_by{rand}.first }.sort
|
36
|
+
op = rand > 0.42 ? [ns[0], :+, ns[1]] : [ns[1], :-, ns[0]]
|
37
|
+
|
38
|
+
question = op.join(' ')
|
39
|
+
answer = op[0].send(op[1], op[2])
|
40
|
+
|
41
|
+
[question, answer]
|
42
|
+
}
|
43
|
+
|
44
|
+
# Call the trait[:captcha] and store question/answer in session
|
45
|
+
def simple_captcha
|
46
|
+
question, answer = ancestral_trait[:captcha].call
|
47
|
+
|
48
|
+
session[:CAPTCHA] = { :question => question, :answer => answer.to_s }
|
49
|
+
|
50
|
+
question
|
51
|
+
end
|
52
|
+
|
53
|
+
# check the given +answer+ against the answer stored in the session.
|
54
|
+
def check_captcha(answer)
|
55
|
+
return false unless captcha = session[:CAPTCHA]
|
56
|
+
|
57
|
+
answer.to_s.strip == captcha[:answer].to_s
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
module Ramaze
|
5
|
+
module Helper
|
6
|
+
|
7
|
+
# provides an call/answer mechanism, this is useful for example in a
|
8
|
+
# login-system.
|
9
|
+
#
|
10
|
+
# It is basically good to redirect temporarly somewhere else without
|
11
|
+
# forgetting where you come from and offering a nice way to get back
|
12
|
+
# to the last urls.
|
13
|
+
#
|
14
|
+
# Example:
|
15
|
+
#
|
16
|
+
# class AuthController < Controller
|
17
|
+
# helper :stack
|
18
|
+
#
|
19
|
+
# def login pass
|
20
|
+
# if pass == 'password'
|
21
|
+
# session[:logged_in] = true
|
22
|
+
# answer '/'
|
23
|
+
# else
|
24
|
+
# "failed"
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# def logged_in?
|
29
|
+
# !!session[:logged_in]
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# class ImportantController < Controller
|
34
|
+
# helper :stack
|
35
|
+
#
|
36
|
+
# def secret_information
|
37
|
+
# call :login unless logged_in?
|
38
|
+
# "Agent X is assigned to fight the RubyNinjas"
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
module Stack
|
42
|
+
# redirect to another location and pushing the current location
|
43
|
+
# on the session[:STACK]
|
44
|
+
def push(frame)
|
45
|
+
(session[:STACK] ||= []) << frame
|
46
|
+
end
|
47
|
+
|
48
|
+
def call(this)
|
49
|
+
push(request.fullpath)
|
50
|
+
redirect(this)
|
51
|
+
end
|
52
|
+
|
53
|
+
# return to the last location on session[:STACK]
|
54
|
+
# The optional alternative paramter will be used to redirect in case you
|
55
|
+
# are not inside_stack?
|
56
|
+
# If the session has no stack and no alternative is given this won't do
|
57
|
+
# anything
|
58
|
+
def answer(alternative = nil)
|
59
|
+
if inside_stack?
|
60
|
+
stack = session[:STACK]
|
61
|
+
target = stack.pop
|
62
|
+
session.delete(:STACK) if stack.empty?
|
63
|
+
redirect(target)
|
64
|
+
elsif alternative
|
65
|
+
redirect(alternative)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# check if the stack has something inside.
|
70
|
+
def inside_stack?
|
71
|
+
session[:STACK] and session[:STACK].any?
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require 'tagz'
|
5
|
+
|
6
|
+
module Ramaze
|
7
|
+
|
8
|
+
# Allows you to use some shortcuts for Tagz in your Controller.
|
9
|
+
|
10
|
+
# use this inside your controller to directly build Tagz
|
11
|
+
# Refer to the Tagz-documentation and testsuite for more examples.
|
12
|
+
# Usage:
|
13
|
+
# tagz { h1_{ "Apples & Oranges" } } #=> "<h1>Apples & Oranges</h1>"
|
14
|
+
# tagz { h1_(:class => 'fruits&floots'){ 'Apples' } } #=> "<h1 class=\"fruits&floots\">Apples</h1>"
|
15
|
+
|
16
|
+
module Helper
|
17
|
+
Tagz = ::Tagz
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
module Ramaze
|
5
|
+
module Helper::Thread
|
6
|
+
def thread &block
|
7
|
+
parent_thread = Thread.current
|
8
|
+
Thread.new do
|
9
|
+
begin
|
10
|
+
block.call
|
11
|
+
rescue Exception => e
|
12
|
+
parent_thread.raise(e)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Ramaze
|
2
|
+
module Helper
|
3
|
+
module Ultraviolet
|
4
|
+
include Innate::Traited
|
5
|
+
|
6
|
+
trait :ultraviolet => {
|
7
|
+
:output => 'xhtml',
|
8
|
+
:syntax => nil, # syntax_name, nil|false indicates automatic detection
|
9
|
+
:line_numbers => false,
|
10
|
+
:style => 'classic', # render_style
|
11
|
+
:headers => false, # ouput document with all headers
|
12
|
+
}
|
13
|
+
|
14
|
+
# Parse and output the file at the given path.
|
15
|
+
# Please head over to the Ultraviolet documentation for more information
|
16
|
+
# on possible options.
|
17
|
+
def ultraviolet(path, options = {})
|
18
|
+
o = ancestral_trait[:ultraviolet].merge(options)
|
19
|
+
output, syntax, lines, style, headers =
|
20
|
+
o.values_at(:output, :syntax, :line_numbers, :style, :headers)
|
21
|
+
|
22
|
+
syntax ||= Uv.syntax_for_file(path).first.first
|
23
|
+
code = File.read(path)
|
24
|
+
|
25
|
+
p [code, output, syntax, lines, style, headers]
|
26
|
+
Uv.parse(code, output, syntax, lines, style, headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Return absolute path to the css of given name.
|
30
|
+
#
|
31
|
+
# Usually this will point to somewhere in the gem tree.
|
32
|
+
#
|
33
|
+
# It seems like Uv will add support for user-defined PATH in the future,
|
34
|
+
# so we will, to be future-proof, traverse the Uv.path even though it
|
35
|
+
# currently will only have one directory.
|
36
|
+
|
37
|
+
def ultraviolet_css(theme)
|
38
|
+
Uv.path.each do |path|
|
39
|
+
Dir[path/"render/xhtml/files/css/*.css"].each do |css|
|
40
|
+
return css if File.basename(css, '.css') == theme
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
module Ramaze
|
2
|
+
module Helper
|
3
|
+
|
4
|
+
# This helper provides a convenience wrapper for handling authentication
|
5
|
+
# and persistence of users.
|
6
|
+
#
|
7
|
+
# On every request, when you use the {User#user} method for the first time,
|
8
|
+
# we confirm the authentication and store the returned object in the
|
9
|
+
# request.env, usually this will involve a request to your database.
|
10
|
+
#
|
11
|
+
# @example Basic usage with User::authenticate
|
12
|
+
#
|
13
|
+
# # We assume that User::[] will make a query and returns the requested
|
14
|
+
# # User instance. This instance will be wrapped and cached.
|
15
|
+
#
|
16
|
+
# class User
|
17
|
+
# def self.authenticate(creds)
|
18
|
+
# User[:name => creds['name'], :pass => creds['pass']]
|
19
|
+
# end
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# class Profiles < Ramaze::Controller
|
23
|
+
# helper :user
|
24
|
+
#
|
25
|
+
# def edit
|
26
|
+
# redirect_referrer unless logged_in?
|
27
|
+
# "Your profile is shown, your are logged in."
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# class Accounts < Ramaze::Controller
|
32
|
+
# helper :user
|
33
|
+
#
|
34
|
+
# def login
|
35
|
+
# return unless request.post?
|
36
|
+
# user_login(request.subset(:name, :pass))
|
37
|
+
# redirect Profiles.r(:edit)
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# def logout
|
41
|
+
# user_logout
|
42
|
+
# redirect_referer
|
43
|
+
# end
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# On every request it checks authentication again and retrieves the model,
|
47
|
+
# we are not using a normal cache for this as it may lead to behaviour that
|
48
|
+
# is very hard to predict and debug.
|
49
|
+
#
|
50
|
+
# You can however, add your own caching quite easily.
|
51
|
+
#
|
52
|
+
# @example caching the authentication lookup with memcached
|
53
|
+
#
|
54
|
+
# # Add the name of the cache you are going to use for the authentication
|
55
|
+
# # and set all caches to use memcached
|
56
|
+
#
|
57
|
+
# Ramaze::Cache.options do |cache|
|
58
|
+
# cache.names = [:session, :user]
|
59
|
+
# cache.default = Ramaze::Cache::MemCache
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# class User
|
63
|
+
#
|
64
|
+
# # Try to fetch the user from the cache, if that fails make a query.
|
65
|
+
# # We are using a ttl (time to live) of one hour, that's just to show
|
66
|
+
# # you how to do it and not necessary.
|
67
|
+
# def self.authenticate(credentials)
|
68
|
+
# cache = Ramaze::Cache.user
|
69
|
+
#
|
70
|
+
# if user = cache[credentials]
|
71
|
+
# return user
|
72
|
+
# elsif user = User[:name => creds['name'], :pass => creds['pass']]
|
73
|
+
# cache.store(credentials, user, :ttl => 3600)
|
74
|
+
# end
|
75
|
+
# end
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# @example Using a lambda instead of User::authenticate
|
79
|
+
#
|
80
|
+
# # assumes all your controllers inhert from this one
|
81
|
+
#
|
82
|
+
# class Controller < Ramaze::Controller
|
83
|
+
# trait :user_callback => lambda{|creds|
|
84
|
+
# User[:name => creds['name'], :pass => creds['pass']]
|
85
|
+
# }
|
86
|
+
# end
|
87
|
+
#
|
88
|
+
# @example Using a different model instead of User
|
89
|
+
#
|
90
|
+
# # assumes all your controllers inhert from this one
|
91
|
+
#
|
92
|
+
# class Controller < Ramaze::Controller
|
93
|
+
# trait :user_model => Account
|
94
|
+
# end
|
95
|
+
#
|
96
|
+
# @author manveru
|
97
|
+
# @todo convert the examples into real examples with specs
|
98
|
+
module User
|
99
|
+
# Using this as key in request.env
|
100
|
+
RAMAZE_HELPER_USER = 'ramaze.helper.user'.freeze
|
101
|
+
|
102
|
+
# Use this method in your application, but do not use it in conditionals
|
103
|
+
# as it will never be nil or false.
|
104
|
+
#
|
105
|
+
# @return [Ramaze::Helper::User::Wrapper] wrapped return value from model or callback
|
106
|
+
#
|
107
|
+
# @api external
|
108
|
+
# @author manveru
|
109
|
+
def user
|
110
|
+
env = request.env
|
111
|
+
found = env[RAMAZE_HELPER_USER]
|
112
|
+
return found if found
|
113
|
+
|
114
|
+
model, callback = ancestral_trait.values_at(:user_model, :user_callback)
|
115
|
+
model ||= ::User
|
116
|
+
env[RAMAZE_HELPER_USER] = Wrapper.new(model, callback)
|
117
|
+
end
|
118
|
+
|
119
|
+
# shortcut for user._login but default argument are request.params
|
120
|
+
#
|
121
|
+
# @param [Hash] creds the credentials that will be passed to callback or model
|
122
|
+
#
|
123
|
+
# @return [nil Hash] the given creds are returned on successful login
|
124
|
+
#
|
125
|
+
# @api external
|
126
|
+
# @see Ramaze::Helper::User::Wrapper#_login
|
127
|
+
# @author manveru
|
128
|
+
def user_login(creds = request.params)
|
129
|
+
user._login(creds)
|
130
|
+
end
|
131
|
+
|
132
|
+
# shortcut for user._logout
|
133
|
+
#
|
134
|
+
# @return [nil]
|
135
|
+
#
|
136
|
+
# @api external
|
137
|
+
# @see Ramaze::Helper::User::Wrapper#_logout
|
138
|
+
# @author manveru
|
139
|
+
def user_logout
|
140
|
+
user._logout
|
141
|
+
end
|
142
|
+
|
143
|
+
# @return [true false] whether the user is logged in already.
|
144
|
+
#
|
145
|
+
# @api external
|
146
|
+
# @see Ramaze::Helper::User::Wrapper#_logged_in?
|
147
|
+
# @author manveru
|
148
|
+
def logged_in?
|
149
|
+
user._logged_in?
|
150
|
+
end
|
151
|
+
|
152
|
+
# Wrapper for the ever-present "user" in your application.
|
153
|
+
# It wraps around an arbitrary instance and worries about authentication
|
154
|
+
# and storing information about the user in the session.
|
155
|
+
#
|
156
|
+
# In order to not interfere with the wrapped instance/model we start our
|
157
|
+
# methods with an underscore.
|
158
|
+
#
|
159
|
+
# Patches and suggestions are highly appreciated.
|
160
|
+
class Wrapper < BlankSlate
|
161
|
+
attr_accessor :_model, :_callback, :_user
|
162
|
+
|
163
|
+
def initialize(model, callback)
|
164
|
+
@_model, @_callback = model, callback
|
165
|
+
@_user = nil
|
166
|
+
_login
|
167
|
+
end
|
168
|
+
|
169
|
+
# @param [Hash] creds this hash will be stored in the session on successful login
|
170
|
+
# @return [Ramaze::Helper::User::Wrapper] wrapped return value from
|
171
|
+
# model or callback
|
172
|
+
# @see Ramaze::Helper::User#user_login
|
173
|
+
# @author manveru
|
174
|
+
def _login(creds = _persistence)
|
175
|
+
if @_user = _would_login?(creds)
|
176
|
+
self._persistence = creds
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# The callback should return an instance of the user, otherwise it
|
181
|
+
# should answer with nil.
|
182
|
+
#
|
183
|
+
# This will not actually login, just check whether the credentials
|
184
|
+
# would result in a user.
|
185
|
+
def _would_login?(creds)
|
186
|
+
if c = @_callback
|
187
|
+
c.call(creds)
|
188
|
+
elsif _model.respond_to?(:authenticate)
|
189
|
+
_model.authenticate(creds)
|
190
|
+
else
|
191
|
+
Log.warn("Helper::User has no callback and there is no %p::authenticate" % _model)
|
192
|
+
nil
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# @api internal
|
197
|
+
# @see Ramaze::Helper::User#user_logout
|
198
|
+
# @author manveru
|
199
|
+
def _logout
|
200
|
+
_persistence.clear
|
201
|
+
Current.request.env['ramaze.helper.user'] = nil
|
202
|
+
end
|
203
|
+
|
204
|
+
# @return [true false] whether the current user is logged in.
|
205
|
+
# @api internal
|
206
|
+
# @see Ramaze::Helper::User#logged_in?
|
207
|
+
# @author manveru
|
208
|
+
def _logged_in?
|
209
|
+
!!_user
|
210
|
+
end
|
211
|
+
|
212
|
+
def _persistence=(creds)
|
213
|
+
Current.session[:USER] = creds
|
214
|
+
end
|
215
|
+
|
216
|
+
def _persistence
|
217
|
+
Current.session[:USER] || {}
|
218
|
+
end
|
219
|
+
|
220
|
+
# Refer everything not known
|
221
|
+
# THINK: This might be quite confusing... should we raise instead?
|
222
|
+
def method_missing(meth, *args, &block)
|
223
|
+
return unless _user
|
224
|
+
_user.send(meth, *args, &block)
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|