ramaze 0.3.9.1 → 2008.06
Sign up to get free protection for your applications and to get access to all the features.
- data/{doc/README → README.markdown} +78 -32
- data/Rakefile +53 -50
- data/benchmark/results.txt +131 -0
- data/benchmark/run.rb +362 -0
- data/benchmark/suite/minimal.rb +13 -0
- data/benchmark/suite/no_informer.rb +9 -0
- data/benchmark/suite/no_sessions.rb +10 -0
- data/benchmark/suite/no_template.rb +9 -0
- data/benchmark/suite/simple.rb +7 -0
- data/benchmark/suite/template_amrita2.rb +17 -0
- data/benchmark/suite/template_builder.rb +12 -0
- data/benchmark/suite/template_erubis.rb +10 -0
- data/benchmark/suite/template_ezamar.rb +10 -0
- data/benchmark/suite/template_haml.rb +15 -0
- data/benchmark/suite/template_liquid.rb +13 -0
- data/benchmark/suite/template_markaby.rb +11 -0
- data/benchmark/suite/template_nagoro.rb +10 -0
- data/benchmark/suite/template_redcloth.rb +15 -0
- data/benchmark/suite/template_tenjin.rb +10 -0
- data/benchmark/test.rb +35 -0
- data/bin/ramaze +32 -122
- data/cache.yaml +7 -0
- data/doc/AUTHORS +26 -22
- data/doc/CHANGELOG +16720 -3907
- data/doc/INSTALL +77 -19
- data/doc/LEGAL +0 -4
- data/doc/meta/announcement.txt +43 -54
- data/doc/meta/configuration.txt +3 -2
- data/doc/readme_chunks/examples.txt +2 -2
- data/doc/readme_chunks/installing.txt +66 -20
- data/doc/tutorial/todolist.html +338 -520
- data/doc/tutorial/todolist.mkd +36 -2
- data/examples/{auth → app/auth}/auth.rb +0 -0
- data/examples/{auth → app/auth}/template/layout.haml +0 -0
- data/examples/{auth → app/auth}/template/login.haml +0 -0
- data/examples/{blog → app/blog}/README +0 -0
- data/examples/{blog → app/blog}/controller/main.rb +1 -1
- data/examples/{blog → app/blog}/model/entry.rb +1 -1
- data/examples/{blog → app/blog}/public/styles/blog.css +0 -0
- data/examples/{blog → app/blog}/spec/blog.rb +2 -2
- data/examples/{blog → app/blog}/start.rb +0 -0
- data/examples/{blog → app/blog}/view/edit.xhtml +0 -0
- data/examples/{blog → app/blog}/view/index.xhtml +0 -0
- data/examples/{blog → app/blog}/view/layout.xhtml +0 -0
- data/examples/{blog → app/blog}/view/new.xhtml +0 -0
- data/examples/app/chat/model/history.rb +36 -0
- data/examples/app/chat/model/message.rb +7 -0
- data/examples/app/chat/public/css/chat.css +13 -0
- data/examples/app/chat/public/js/chat.js +22 -0
- data/examples/app/chat/public/js/jquery.js +3436 -0
- data/examples/app/chat/start.rb +40 -0
- data/examples/app/chat/view/chat.xhtml +9 -0
- data/examples/app/chat/view/index.xhtml +7 -0
- data/examples/app/chat/view/layout.xhtml +13 -0
- data/examples/app/localization/start.rb +35 -0
- data/examples/{rammit → app/rammit}/spec/rammit.rb +2 -1
- data/examples/{rammit → app/rammit}/src/controller/main.rb +0 -0
- data/examples/{rammit → app/rammit}/src/controller/page.rb +0 -0
- data/examples/{rammit → app/rammit}/src/model.rb +0 -0
- data/examples/{rammit → app/rammit}/start.rb +0 -0
- data/examples/{rammit → app/rammit}/template/index.xhtml +0 -0
- data/examples/{rammit → app/rammit}/template/page/view.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/Rakefile +0 -1
- data/examples/{rapaste → app/rapaste}/controller/paste.rb +3 -3
- data/examples/{rapaste → app/rapaste}/model/paste.rb +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/active4d.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/all_hallows_eve.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/amy.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/blackboard.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/brilliance_black.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/brilliance_dull.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/cobalt.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/dawn.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/display.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/eiffel.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/espresso_libre.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/idle.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/iplastic.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/lazy.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/mac_classic.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/magicwb_amiga.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/pastels_on_dark.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/slush_poppies.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/spacecadet.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/sunburst.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/twilight.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/css/zenburnesque.css +0 -0
- data/examples/{rapaste → app/rapaste}/public/js/jquery.js +0 -0
- data/examples/{rapaste → app/rapaste}/spec/rapaste.rb +2 -2
- data/examples/{rapaste → app/rapaste}/start.rb +0 -0
- data/examples/{rapaste → app/rapaste}/view/copy.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/index.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/layout.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/list.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/search.xhtml +0 -0
- data/examples/{rapaste → app/rapaste}/view/view.xhtml +0 -0
- data/examples/{sourceview → app/sourceview}/public/coderay.css +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/file.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/folder.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-collapsable-last.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-collapsable.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-expandable-last.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-expandable.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-item-last.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/images/tv-item.gif +0 -0
- data/examples/{sourceview → app/sourceview}/public/jquery.js +0 -0
- data/examples/{sourceview → app/sourceview}/public/jquery.treeview.css +0 -0
- data/examples/{sourceview → app/sourceview}/public/jquery.treeview.js +0 -0
- data/examples/{sourceview → app/sourceview}/public/sourceview.js +0 -0
- data/examples/{sourceview → app/sourceview}/sourceview.rb +1 -1
- data/examples/{sourceview → app/sourceview}/template/index.haml +0 -0
- data/examples/{todolist → app/todolist}/README +0 -0
- data/examples/{todolist → app/todolist}/public/favicon.ico +0 -0
- data/examples/{todolist → app/todolist}/public/js/jquery.js +0 -0
- data/examples/{todolist → app/todolist}/public/ramaze.png +0 -0
- data/examples/{todolist → app/todolist}/spec/todolist.rb +2 -2
- data/examples/{todolist → app/todolist}/src/controller/main.rb +0 -0
- data/examples/{todolist → app/todolist}/src/element/page.rb +0 -0
- data/examples/{todolist → app/todolist}/src/model.rb +0 -0
- data/examples/{todolist → app/todolist}/start.rb +0 -0
- data/examples/{todolist → app/todolist}/template/index.xhtml +0 -0
- data/examples/{todolist → app/todolist}/template/new.xhtml +0 -0
- data/examples/{upload → app/upload}/start.rb +0 -0
- data/examples/{upload → app/upload}/view/index.xhtml +0 -0
- data/examples/{whywiki → app/whywiki}/spec/whywiki.rb +3 -3
- data/examples/{whywiki → app/whywiki}/start.rb +0 -0
- data/examples/{whywiki → app/whywiki}/template/edit.xhtml +0 -0
- data/examples/{whywiki → app/whywiki}/template/show.xhtml +0 -0
- data/examples/{wikore → app/wikore}/spec/wikore.rb +2 -2
- data/examples/{wikore → app/wikore}/src/controller.rb +0 -0
- data/examples/{wikore → app/wikore}/src/model.rb +0 -0
- data/examples/{wikore → app/wikore}/start.rb +0 -0
- data/examples/{wikore → app/wikore}/template/index.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/README +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/link/2007-07-20_19-45-51.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/link/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_16-31-33.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-21-12.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-23-10.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/2007-07-20_19-45-07.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/main/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/markdown/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-20_16-43-46.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-20_19-43-50.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-46-01.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-46-32.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-47-08.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/2007-07-21_18-47-54.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/mkd/testing/current.mkd +0 -0
- data/examples/{wiktacular → app/wiktacular}/public/favicon.ico +0 -0
- data/examples/{wiktacular → app/wiktacular}/public/screen.css +0 -0
- data/examples/{wiktacular → app/wiktacular}/spec/wiktacular.rb +4 -5
- data/examples/{wiktacular → app/wiktacular}/src/controller.rb +0 -0
- data/examples/{wiktacular → app/wiktacular}/src/model.rb +0 -0
- data/examples/{wiktacular → app/wiktacular}/start.rb +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/edit.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/html_layout.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/index.xhtml +0 -0
- data/examples/{wiktacular → app/wiktacular}/template/new.xhtml +0 -0
- data/examples/{element.rb → basic/element.rb} +0 -0
- data/examples/basic/gestalt.rb +27 -0
- data/examples/{hello.rb → basic/hello.rb} +0 -0
- data/examples/{layout.rb → basic/layout.rb} +0 -0
- data/examples/{linking.rb → basic/linking.rb} +0 -0
- data/examples/{simple.rb → basic/simple.rb} +3 -3
- data/examples/{caching.rb → helpers/cache.rb} +0 -0
- data/examples/helpers/form_with_sequel.rb +24 -0
- data/examples/helpers/httpdigest.rb +50 -0
- data/examples/{identity.rb → helpers/identity.rb} +0 -0
- data/examples/{nitro_form.rb → helpers/nitro_form.rb} +0 -0
- data/examples/helpers/provide.rb +23 -0
- data/examples/helpers/rest.rb +28 -0
- data/examples/helpers/simple_captcha.rb +29 -0
- data/examples/{css.rb → misc/css.rb} +0 -0
- data/examples/{facebook.rb → misc/facebook.rb} +0 -0
- data/examples/{memleak_detector.rb → misc/memleak_detector.rb} +0 -0
- data/examples/misc/nagoro_element.rb +43 -0
- data/examples/{ramaise.rb → misc/ramaise.rb} +0 -0
- data/examples/misc/rapp.rb +45 -0
- data/examples/misc/sequel_scaffolding.rb +34 -0
- data/examples/{simple_auth.rb → misc/simple_auth.rb} +0 -0
- data/examples/templates/template_amrita2.rb +1 -1
- data/examples/templates/template_erubis.rb +2 -2
- data/examples/templates/template_ezamar.rb +1 -1
- data/examples/templates/template_haml.rb +2 -2
- data/examples/templates/template_liquid.rb +2 -2
- data/examples/templates/template_markaby.rb +1 -1
- data/examples/templates/template_nagoro.rb +1 -1
- data/examples/templates/template_redcloth.rb +2 -2
- data/examples/templates/template_remarkably.rb +1 -1
- data/examples/templates/template_tenjin.rb +5 -9
- data/examples/templates/template_xslt.rb +1 -1
- data/lib/proto/public/dispatch.fcgi +0 -0
- data/lib/proto/public/js/jquery.js +750 -577
- data/lib/proto/spec/main.rb +1 -1
- data/lib/proto/start.ru +8 -0
- data/lib/proto/view/page.xhtml +13 -1
- data/lib/ramaze.rb +32 -15
- data/lib/ramaze/action.rb +18 -1
- data/lib/ramaze/action/render.rb +45 -17
- data/lib/ramaze/adapter.rb +8 -7
- data/lib/ramaze/adapter/base.rb +79 -13
- data/lib/ramaze/adapter/cgi.rb +5 -10
- data/lib/ramaze/adapter/ebb.rb +6 -20
- data/lib/ramaze/adapter/fake.rb +12 -0
- data/lib/ramaze/adapter/fcgi.rb +5 -11
- data/lib/ramaze/adapter/lsws.rb +5 -9
- data/lib/ramaze/adapter/mongrel.rb +5 -9
- data/lib/ramaze/adapter/scgi.rb +4 -8
- data/lib/ramaze/adapter/thin.rb +6 -11
- data/lib/ramaze/adapter/webrick.rb +13 -22
- data/lib/ramaze/cache.rb +36 -10
- data/lib/ramaze/cache/memcached.rb +3 -2
- data/lib/ramaze/contrib.rb +1 -1
- data/lib/ramaze/contrib/email.rb +1 -1
- data/lib/ramaze/contrib/file_cache.rb +1 -1
- data/lib/ramaze/contrib/gems.rb +79 -0
- data/lib/ramaze/contrib/gettext/po.rb +0 -0
- data/lib/ramaze/contrib/profiling.rb +1 -1
- data/lib/ramaze/contrib/rest.rb +14 -0
- data/lib/ramaze/controller.rb +45 -12
- data/lib/ramaze/controller/error.rb +4 -4
- data/lib/ramaze/controller/resolve.rb +61 -42
- data/lib/ramaze/current.rb +2 -2
- data/lib/ramaze/current/request.rb +25 -2
- data/lib/ramaze/current/response.rb +8 -0
- data/lib/ramaze/current/session.rb +64 -36
- data/lib/ramaze/current/session/flash.rb +14 -2
- data/lib/ramaze/current/session/hash.rb +3 -2
- data/lib/ramaze/dispatcher.rb +25 -12
- data/lib/ramaze/dispatcher/action.rb +12 -3
- data/lib/ramaze/dispatcher/directory.rb +4 -1
- data/lib/ramaze/dispatcher/error.rb +3 -3
- data/lib/ramaze/dispatcher/file.rb +11 -3
- data/lib/ramaze/gestalt.rb +1 -1
- data/lib/ramaze/helper.rb +17 -21
- data/lib/ramaze/helper/aspect.rb +20 -14
- data/lib/ramaze/helper/auth.rb +1 -1
- data/lib/ramaze/helper/cache.rb +3 -6
- data/lib/ramaze/helper/cgi.rb +6 -2
- data/lib/ramaze/helper/flash.rb +7 -7
- data/lib/ramaze/helper/form.rb +281 -0
- data/lib/ramaze/helper/formatting.rb +76 -0
- data/lib/ramaze/helper/gestalt.rb +15 -0
- data/lib/ramaze/helper/gravatar.rb +15 -0
- data/lib/ramaze/helper/httpdigest.rb +48 -0
- data/lib/ramaze/helper/identity.rb +87 -62
- data/lib/ramaze/helper/partial.rb +11 -2
- data/lib/ramaze/helper/redirect.rb +12 -3
- data/lib/ramaze/helper/rest.rb +43 -0
- data/lib/ramaze/helper/sendfile.rb +1 -3
- data/lib/ramaze/helper/sequel.rb +3 -0
- data/lib/ramaze/helper/simple_captcha.rb +31 -0
- data/lib/ramaze/helper/stack.rb +14 -5
- data/lib/ramaze/helper/user.rb +86 -34
- data/lib/ramaze/helper/xhtml.rb +23 -0
- data/lib/ramaze/log.rb +1 -2
- data/lib/ramaze/log/analogger.rb +24 -19
- data/lib/ramaze/log/growl.rb +24 -19
- data/lib/ramaze/log/hub.rb +25 -22
- data/lib/ramaze/log/informer.rb +104 -99
- data/lib/ramaze/log/knotify.rb +17 -12
- data/lib/ramaze/log/logger.rb +14 -8
- data/lib/ramaze/log/logging.rb +63 -60
- data/lib/ramaze/log/syslog.rb +24 -19
- data/lib/ramaze/log/xosd.rb +77 -71
- data/lib/ramaze/option.rb +153 -0
- data/lib/ramaze/option/dsl.rb +45 -0
- data/lib/ramaze/option/holder.rb +153 -0
- data/lib/ramaze/option/merger.rb +108 -0
- data/lib/ramaze/route.rb +15 -2
- data/lib/ramaze/setup.rb +50 -0
- data/lib/ramaze/snippets/binding/locals.rb +1 -1
- data/lib/ramaze/snippets/dictionary.rb +3 -3
- data/lib/ramaze/snippets/divide.rb +7 -7
- data/lib/ramaze/snippets/kernel/__dir__.rb +1 -1
- data/lib/ramaze/snippets/kernel/acquire.rb +0 -5
- data/lib/ramaze/snippets/metaid.rb +1 -1
- data/lib/ramaze/snippets/numeric/filesize_format.rb +11 -5
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +8 -0
- data/lib/ramaze/snippets/object/scope.rb +1 -1
- data/lib/ramaze/snippets/object/thread_accessor.rb +1 -1
- data/lib/ramaze/snippets/ordered_set.rb +5 -1
- data/lib/ramaze/snippets/ramaze/deprecated.rb +7 -0
- data/lib/ramaze/snippets/ramaze/thread_accessor.rb +15 -1
- data/lib/ramaze/snippets/string/esc.rb +2 -2
- data/lib/ramaze/snippets/string/start_with.rb +1 -0
- data/lib/ramaze/snippets/string/unindent.rb +9 -1
- data/lib/ramaze/snippets/struct/values_at.rb +17 -1
- data/lib/ramaze/snippets/thread/into.rb +1 -1
- data/lib/ramaze/sourcereload.rb +83 -76
- data/lib/ramaze/spec/helper.rb +39 -26
- data/lib/ramaze/spec/helper/bacon.rb +5 -5
- data/lib/ramaze/spec/helper/mock_http.rb +1 -7
- data/lib/ramaze/spec/helper/pretty_output.rb +10 -2
- data/lib/ramaze/spec/helper/requester.rb +14 -0
- data/lib/ramaze/template.rb +6 -3
- data/lib/ramaze/template/amrita2.rb +1 -0
- data/lib/ramaze/template/erubis.rb +7 -1
- data/lib/ramaze/template/ezamar/render_partial.rb +1 -1
- data/lib/ramaze/template/nagoro.rb +1 -0
- data/lib/ramaze/template/redcloth.rb +1 -0
- data/lib/ramaze/template/tagz.rb +8 -8
- data/lib/ramaze/template/tenjin.rb +42 -2
- data/lib/ramaze/template/xslt.rb +4 -0
- data/lib/ramaze/tool/daemonize.rb +37 -0
- data/lib/ramaze/tool/localize.rb +142 -106
- data/lib/ramaze/version.rb +2 -10
- data/rake_tasks/conf.rake +11 -13
- data/rake_tasks/gem.rake +59 -37
- data/rake_tasks/git.rake +41 -0
- data/rake_tasks/maintenance.rake +263 -299
- data/rake_tasks/release.rake +63 -0
- data/rake_tasks/spec.rake +1 -1
- data/ramaze.gemspec +731 -0
- data/spec/contrib/profiling.rb +5 -2
- data/spec/examples/caching.rb +1 -1
- data/spec/examples/css.rb +1 -1
- data/spec/examples/element.rb +1 -1
- data/spec/examples/hello.rb +1 -1
- data/spec/examples/linking.rb +1 -1
- data/spec/examples/simple.rb +1 -1
- data/spec/examples/simple_auth.rb +1 -1
- data/spec/ramaze/action/cache.rb +58 -14
- data/spec/ramaze/action/file_cache.rb +48 -0
- data/spec/ramaze/action/layout.rb +2 -2
- data/spec/ramaze/action/render.rb +1 -2
- data/spec/ramaze/action/{template → view}/bar.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/instancevars/layout.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/other_wrapper.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/single_wrapper.xhtml +0 -0
- data/spec/ramaze/action/{template → view}/sub/sub_wrapper.xhtml +0 -0
- data/spec/ramaze/adapter.rb +29 -2
- data/spec/ramaze/adapter/ebb.rb +12 -0
- data/spec/ramaze/cache.rb +82 -15
- data/spec/ramaze/controller.rb +6 -3
- data/spec/ramaze/controller/actionless_templates.rb +2 -2
- data/spec/ramaze/controller/resolve.rb +1 -1
- data/spec/ramaze/controller/template_resolving.rb +4 -6
- data/spec/ramaze/controller/{template → view}/greet.xhtml +0 -0
- data/spec/ramaze/controller/{template → view}/list.xhtml +0 -0
- data/spec/ramaze/controller/{template → view}/other/greet/other.xhtml +0 -0
- data/spec/ramaze/controller/{template → view}/other_wrapper.xhtml +0 -0
- data/spec/ramaze/error.rb +1 -1
- data/spec/ramaze/helper/aspect.rb +4 -4
- data/spec/ramaze/helper/cache.rb +56 -39
- data/spec/ramaze/helper/flash.rb +14 -1
- data/spec/ramaze/helper/form.rb +118 -0
- data/spec/ramaze/helper/formatting.rb +21 -0
- data/spec/ramaze/helper/link.rb +2 -2
- data/spec/ramaze/helper/pager.rb +2 -2
- data/spec/ramaze/helper/partial.rb +13 -1
- data/spec/ramaze/helper/simple_captcha.rb +22 -0
- data/spec/ramaze/helper/user.rb +7 -10
- data/spec/ramaze/helper/{template → view}/locals.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/loop.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/num.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/partial.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/recursive.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/recursive_local_ivars.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/recursive_locals.xhtml +0 -0
- data/spec/ramaze/helper/{template → view}/test_template.xhtml +0 -0
- data/spec/ramaze/localize.rb +22 -0
- data/spec/ramaze/log/informer.rb +10 -10
- data/spec/ramaze/log/syslog.rb +1 -1
- data/spec/ramaze/request.rb +13 -1
- data/spec/ramaze/request/ebb.rb +9 -0
- data/spec/ramaze/rewrite.rb +36 -0
- data/spec/ramaze/rewrite/file.css +1 -0
- data/spec/ramaze/route.rb +1 -0
- data/spec/ramaze/template.rb +5 -5
- data/spec/ramaze/template/amrita2.rb +1 -1
- data/spec/ramaze/template/builder.rb +18 -22
- data/spec/ramaze/template/erubis.rb +1 -1
- data/spec/ramaze/template/ezamar.rb +1 -1
- data/spec/ramaze/template/haml.rb +2 -2
- data/spec/ramaze/template/liquid.rb +1 -1
- data/spec/ramaze/template/markaby.rb +1 -1
- data/spec/ramaze/template/nagoro.rb +1 -1
- data/spec/ramaze/template/redcloth.rb +1 -1
- data/spec/ramaze/template/remarkably.rb +1 -1
- data/spec/ramaze/template/sass.rb +1 -1
- data/spec/ramaze/template/tagz.rb +1 -1
- data/spec/ramaze/template/tenjin.rb +4 -6
- data/spec/ramaze/template/xslt.rb +1 -1
- data/spec/snippets/string/unindent.rb +6 -0
- data/spec/snippets/struct/values_at.rb +8 -0
- metadata +522 -487
- data/doc/ProjectInfo +0 -53
- data/doc/migrate/1110_to_1111.txt +0 -131
- data/lib/ramaze/contrib/route.rb +0 -22
- data/lib/ramaze/global.rb +0 -116
- data/lib/ramaze/global/dsl.rb +0 -39
- data/lib/ramaze/global/globalstruct.rb +0 -147
- data/lib/ramaze/helper/inform.rb +0 -40
- data/lib/ramaze/inform.rb +0 -4
- data/lib/ramaze/snippets/kernel/aquire.rb +0 -1
- data/lib/vendor/bacon.rb +0 -323
- data/rake_tasks/darcs.rake +0 -5
- data/spec/contrib/route.rb +0 -36
data/lib/ramaze/log/logger.rb
CHANGED
@@ -4,19 +4,25 @@
|
|
4
4
|
require 'logger'
|
5
5
|
|
6
6
|
module Ramaze
|
7
|
+
module Logging
|
8
|
+
module Logger
|
7
9
|
|
8
|
-
|
10
|
+
# Informer for the Stdlib Logger
|
9
11
|
|
10
|
-
|
12
|
+
class Logger < ::Logger
|
11
13
|
|
12
|
-
|
14
|
+
# integration to Logging
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
def log(tag, *args)
|
17
|
+
__send__(tag, args.join("\n"))
|
18
|
+
end
|
19
|
+
|
20
|
+
# Stub for compatibility
|
21
|
+
def dev(*args)
|
22
|
+
debug(*args)
|
23
|
+
end
|
24
|
+
end
|
17
25
|
|
18
|
-
def dev(*args)
|
19
|
-
debug(*args)
|
20
26
|
end
|
21
27
|
end
|
22
28
|
end
|
data/lib/ramaze/log/logging.rb
CHANGED
@@ -2,87 +2,90 @@
|
|
2
2
|
# All files in this distribution are subject to the terms of the Ruby license.
|
3
3
|
|
4
4
|
module Ramaze
|
5
|
-
|
6
|
-
# This module provides a basic skeleton for your own loggers to be compatible.
|
7
|
-
# The minimal usage is like this:
|
8
|
-
#
|
9
|
-
# class MyLogger
|
10
|
-
# include Logging
|
11
|
-
#
|
12
|
-
# def log(tag, *args)
|
13
|
-
# p tag => args
|
14
|
-
# end
|
15
|
-
# end
|
16
|
-
|
17
5
|
module Logging
|
18
6
|
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
7
|
+
# This module provides a basic skeleton for your own loggers to be compatible.
|
8
|
+
# The minimal usage is like this:
|
9
|
+
#
|
10
|
+
# class MyLogger
|
11
|
+
# include Logging
|
12
|
+
#
|
13
|
+
# def log(tag, *args)
|
14
|
+
# p tag => args
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
|
18
|
+
module Logging
|
19
|
+
|
20
|
+
# Takes the tag (:warn|:debug|:error|:info) and the name of a method to be
|
21
|
+
# called upon elements of msgs that don't respond to :to_str
|
22
|
+
# Goes on and sends the tag and transformed messages each to the #log method.
|
23
|
+
# If you include this module you have to define #log or it will raise.
|
24
|
+
|
25
|
+
def tag_log(tag, meth, *msgs)
|
26
|
+
msgs.each do |msg|
|
27
|
+
string = (msg.respond_to?(:to_str) ? msg : msg.send(meth))
|
28
|
+
log(tag, string)
|
29
|
+
end
|
28
30
|
end
|
29
|
-
end
|
30
31
|
|
31
|
-
|
32
|
+
# Converts everything given to strings and passes them on with :info
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
def info(*objects)
|
35
|
+
tag_log(:info, :to_s, *objects)
|
36
|
+
end
|
36
37
|
|
37
|
-
|
38
|
+
# Converts everything given to strings and passes them on with :warn
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
def warn(*objects)
|
41
|
+
tag_log(:warn, :to_s, *objects)
|
42
|
+
end
|
42
43
|
|
43
|
-
|
44
|
+
# inspects objects if they are no strings. Tag is :debug
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
46
|
+
def debug(*objects)
|
47
|
+
tag_log(:debug, :inspect, *objects)
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
+
# inspects objects if they are no strings. Tag is :dev
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
52
|
+
def dev(*objects)
|
53
|
+
tag_log(:dev, :inspect, *objects)
|
54
|
+
end
|
54
55
|
|
55
|
-
|
56
|
+
alias << debug
|
56
57
|
|
57
|
-
|
58
|
-
|
58
|
+
# Takes either an Exception or just a String, formats backtraces to be a bit
|
59
|
+
# more readable and passes all of this on to tag_log :error
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
def error(ex)
|
62
|
+
if ex.respond_to?(:exception)
|
63
|
+
message = [ex.backtrace].flatten[0..Global.backtrace_size]
|
64
|
+
message.map{|m| m.to_s.gsub(/^#{Regexp.escape(Dir.pwd)}/, '.') }
|
65
|
+
message.unshift(ex.inspect)
|
66
|
+
else
|
67
|
+
message = ex.to_s
|
68
|
+
end
|
69
|
+
tag_log(:error, :to_s, *message)
|
67
70
|
end
|
68
|
-
tag_log(:error, :to_s, *message)
|
69
|
-
end
|
70
71
|
|
71
|
-
|
72
|
+
# raises
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
def log(*args)
|
75
|
+
raise "#log should be implemented by an instance including this module (#{self})"
|
76
|
+
end
|
76
77
|
|
77
|
-
|
78
|
+
# nothing
|
78
79
|
|
79
|
-
|
80
|
-
|
80
|
+
def shutdown
|
81
|
+
end
|
81
82
|
|
82
|
-
|
83
|
+
# stub for WEBrick
|
83
84
|
|
84
|
-
|
85
|
-
|
85
|
+
def debug?
|
86
|
+
false
|
87
|
+
end
|
86
88
|
end
|
89
|
+
|
87
90
|
end
|
88
91
|
end
|
data/lib/ramaze/log/syslog.rb
CHANGED
@@ -4,33 +4,38 @@
|
|
4
4
|
require 'syslog'
|
5
5
|
|
6
6
|
module Ramaze
|
7
|
+
module Logging
|
8
|
+
module Logger
|
7
9
|
|
8
|
-
|
10
|
+
# Informer for Syslog from rubys standard-library.
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
+
class Syslog
|
13
|
+
include ::Syslog
|
12
14
|
|
13
|
-
|
15
|
+
# opens syslog
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
def initialize
|
18
|
+
open unless ::Syslog.opened?
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
# alias for default syslog methods so they match ramaze
|
22
|
+
alias error err
|
23
|
+
alias warn warning
|
24
|
+
alias dev debug
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
# just sends all messages received to ::Syslog
|
27
|
+
def inform(tag, *args)
|
28
|
+
self.__send__(tag, *args)
|
29
|
+
end
|
30
|
+
|
31
|
+
public :error, :warn
|
28
32
|
|
29
|
-
|
33
|
+
# Has to call the modules singleton-method.
|
34
|
+
def inspect
|
35
|
+
::Syslog.inspect
|
36
|
+
end
|
37
|
+
end
|
30
38
|
|
31
|
-
# Has to call the modules singleton-method.
|
32
|
-
def inspect
|
33
|
-
::Syslog.inspect
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
data/lib/ramaze/log/xosd.rb
CHANGED
@@ -1,88 +1,94 @@
|
|
1
1
|
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
|
2
2
|
# All files in this distribution are subject to the terms of the Ruby license.
|
3
3
|
|
4
|
+
Ramaze::Log.log( :warn, "Both xosd gems are currently known to be broken" )
|
4
5
|
require 'xosd'
|
5
6
|
require 'thread'
|
6
7
|
|
7
8
|
module Ramaze
|
9
|
+
module Logging
|
10
|
+
module Logger
|
11
|
+
|
12
|
+
# Informer for the XOSD notification system for X11.
|
13
|
+
#
|
14
|
+
# You can install the ruby-bindings with:
|
15
|
+
# gem install xosd.
|
16
|
+
|
17
|
+
class Xosd < ::Xosd
|
18
|
+
attr_accessor :options
|
19
|
+
|
20
|
+
include Logging
|
21
|
+
|
22
|
+
DEFAULT = {
|
23
|
+
:font_size => 20,
|
24
|
+
:font => "-*-*-*-*-*-*-%d-*-*-*-*-*-*-*",
|
25
|
+
:align => 'center',
|
26
|
+
:color => '#FFFFFF',
|
27
|
+
:lines => 3,
|
28
|
+
:valign => 'top',
|
29
|
+
:timeout => 3,
|
30
|
+
:outline_color => "#000000",
|
31
|
+
:outline_width => 1,
|
32
|
+
:vertical_offset => 20,
|
33
|
+
:colors => {
|
34
|
+
:error => "#FF0000",
|
35
|
+
:info => "#00FF00",
|
36
|
+
:warn => "#EAA61E",
|
37
|
+
:debug => "#FFFF00"
|
38
|
+
},
|
39
|
+
}
|
40
|
+
|
41
|
+
# keys to ignore when setting the options to the instance.
|
42
|
+
IGNORE = [:colors, :font_size, :lines]
|
43
|
+
|
44
|
+
# Here new messages are pushed to eventually displaying them.
|
45
|
+
QUEUE = Queue.new
|
46
|
+
|
47
|
+
# Create a new instance, valid options are in DEFAULT.
|
48
|
+
# In the background a new thread will be running that checks the QUEUE
|
49
|
+
# and processes all messages that are being sent to it.
|
50
|
+
# This is done to make output nicer and readable.
|
51
|
+
|
52
|
+
def initialize(options = {})
|
53
|
+
@options = DEFAULT.merge(options)
|
54
|
+
|
55
|
+
super(@options[:lines])
|
56
|
+
|
57
|
+
@options.each do |key, value|
|
58
|
+
next if IGNORE.include?(key)
|
59
|
+
value %= @options[:font_size] if key == :font
|
60
|
+
send("#{key}=", value)
|
61
|
+
end
|
8
62
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
:valign => 'top',
|
26
|
-
:timeout => 3,
|
27
|
-
:outline_color => "#000000",
|
28
|
-
:outline_width => 1,
|
29
|
-
:vertical_offset => 20,
|
30
|
-
:colors => {
|
31
|
-
:error => "#FF0000",
|
32
|
-
:info => "#00FF00",
|
33
|
-
:warn => "#EAA61E",
|
34
|
-
:debug => "#FFFF00"
|
35
|
-
},
|
36
|
-
}
|
37
|
-
|
38
|
-
# keys to ignore when setting the options to the instance.
|
39
|
-
IGNORE = [:colors, :font_size, :lines]
|
40
|
-
|
41
|
-
# Here new messages are pushed to eventually displaying them.
|
42
|
-
QUEUE = Queue.new
|
43
|
-
|
44
|
-
# Create a new instance, valid options are in DEFAULT.
|
45
|
-
# In the background a new thread will be running that checks the QUEUE
|
46
|
-
# and processes all messages that are being sent to it.
|
47
|
-
# This is done to make output nicer and readable.
|
48
|
-
|
49
|
-
def initialize(options = {})
|
50
|
-
@options = DEFAULT.merge(options)
|
51
|
-
|
52
|
-
super(@options[:lines])
|
53
|
-
|
54
|
-
@options.each do |key, value|
|
55
|
-
next if IGNORE.include?(key)
|
56
|
-
value %= @options[:font_size] if key == :font
|
57
|
-
send("#{key}=", value)
|
58
|
-
end
|
59
|
-
|
60
|
-
Thread.new(self) do |xosd|
|
61
|
-
loop do
|
62
|
-
items = []
|
63
|
-
lines = xosd.options[:lines]
|
64
|
-
items << QUEUE.shift until QUEUE.empty? or items.size >= lines
|
65
|
-
|
66
|
-
unless items.empty?
|
67
|
-
# pad up with empty lines to avoid dragging around old messages.
|
68
|
-
items << [:info, ' '] until items.size >= lines
|
69
|
-
|
70
|
-
items.each_with_index do |(tag, message), i|
|
71
|
-
xosd.color = xosd.options[:colors][tag.to_sym]
|
72
|
-
xosd.display(message, i)
|
63
|
+
Thread.new(self) do |xosd|
|
64
|
+
loop do
|
65
|
+
items = []
|
66
|
+
lines = xosd.options[:lines]
|
67
|
+
items << QUEUE.shift until QUEUE.empty? or items.size >= lines
|
68
|
+
|
69
|
+
unless items.empty?
|
70
|
+
# pad up with empty lines to avoid dragging around old messages.
|
71
|
+
items << [:info, ' '] until items.size >= lines
|
72
|
+
|
73
|
+
items.each_with_index do |(tag, message), i|
|
74
|
+
xosd.color = xosd.options[:colors][tag.to_sym]
|
75
|
+
xosd.display(message, i)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
sleep xosd.options[:timeout]
|
73
79
|
end
|
74
80
|
end
|
75
|
-
sleep xosd.options[:timeout]
|
76
81
|
end
|
77
|
-
end
|
78
|
-
end
|
79
82
|
|
80
|
-
|
83
|
+
# pushes all messages it gets on the QUEUE for further processing.
|
81
84
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
+
def log(tag, *messages)
|
86
|
+
messages.each do |message|
|
87
|
+
QUEUE << [tag, message]
|
88
|
+
end
|
89
|
+
end
|
85
90
|
end
|
91
|
+
|
86
92
|
end
|
87
93
|
end
|
88
94
|
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
require 'ramaze/option/dsl'
|
2
|
+
require 'ramaze/option/holder'
|
3
|
+
|
4
|
+
module Ramaze
|
5
|
+
Global = Option::Holder.new
|
6
|
+
|
7
|
+
Option::DSL.new Global do
|
8
|
+
o "List of aliases for adapters",
|
9
|
+
:adapter_aliases, {
|
10
|
+
"mongrel" => "Mongrel",
|
11
|
+
"evented_mongrel" => "Mongrel",
|
12
|
+
"fcgi" => "Fcgi",
|
13
|
+
"thin" => "Thin",
|
14
|
+
"ebb" => "Ebb",
|
15
|
+
"cgi" => "CGI",
|
16
|
+
"lsws" => "LSWS",
|
17
|
+
"scgi" => "SCGI",
|
18
|
+
"webrick" => "WEBrick",
|
19
|
+
"swiftiplied_mongrel" => "Mongrel",
|
20
|
+
}
|
21
|
+
|
22
|
+
o "Hash of aliases for caches",
|
23
|
+
:cache_aliases, {
|
24
|
+
"memory" => "MemoryCache",
|
25
|
+
"yaml" => "YAMLStoreCache",
|
26
|
+
"memcache" => "MemcachedCache",
|
27
|
+
"memcached" => "MemcachedCache",
|
28
|
+
}
|
29
|
+
|
30
|
+
o "Disable templates without actions",
|
31
|
+
:actionless_templates, true, :cli => true
|
32
|
+
|
33
|
+
o "Set adapter Ramaze will run on.",
|
34
|
+
:adapter, :webrick, :cli => @config[:adapter_aliases][1].keys, :short => :a
|
35
|
+
|
36
|
+
o "Set the size of Backtrace shown.",
|
37
|
+
:backtrace_size, 10, :cli => 10
|
38
|
+
|
39
|
+
o "Turn benchmarking every request on.",
|
40
|
+
:benchmarking, false, :short => :b, :cli => false
|
41
|
+
|
42
|
+
o "Do not log about these requests to static files, values as in Global.ignore",
|
43
|
+
:boring, ["/favicon.ico"]
|
44
|
+
|
45
|
+
o "Use this for general caching and as base for Cache.new.",
|
46
|
+
:cache, :memory, :cli => [:memory, :memcached, :yaml]
|
47
|
+
|
48
|
+
o "Turn on naive caching of all requests.",
|
49
|
+
:cache_all, false, :cli => false
|
50
|
+
|
51
|
+
o "Alternative caches",
|
52
|
+
:cache_alternative, {}
|
53
|
+
|
54
|
+
o "Don't cache action if session flash data is present for a request.",
|
55
|
+
:no_cache_flash, true, :cli => true
|
56
|
+
|
57
|
+
o "Compile Templates",
|
58
|
+
:compile, false, :cli => false
|
59
|
+
|
60
|
+
o "Start Ramaze within an IRB session",
|
61
|
+
:console, false, :short => :c
|
62
|
+
|
63
|
+
o "Active contribs",
|
64
|
+
:contribs, Set.new
|
65
|
+
|
66
|
+
o "Set default Content-Type for responses",
|
67
|
+
:content_type, "text/html"
|
68
|
+
|
69
|
+
o "Set default Accept-Charset for responses. No header set if nil.",
|
70
|
+
:accept_charset, nil
|
71
|
+
|
72
|
+
o "All subclasses of Controller are collected here.",
|
73
|
+
:controllers, Set.new
|
74
|
+
|
75
|
+
o "Instruction for daemonize, only works with bin/ramaze for now",
|
76
|
+
:daemonize, 'start', :cli => [:start, :stop]
|
77
|
+
|
78
|
+
o "Turn on customized error pages.",
|
79
|
+
:error_page, true, :cli => true
|
80
|
+
|
81
|
+
o "Caching actions to the filesystem in Global.public_root",
|
82
|
+
:file_cache, false, :cli => false
|
83
|
+
|
84
|
+
o "Specify what IP Ramaze will respond to - 0.0.0.0 for all",
|
85
|
+
:host, "0.0.0.0", :cli => "0.0.0.0"
|
86
|
+
|
87
|
+
o "Ignore requests to these paths if no file in public_root exists, absolute path or regex",
|
88
|
+
:ignore, ["/favicon.ico"]
|
89
|
+
|
90
|
+
o "Body set on ignored paths",
|
91
|
+
:ignore_body, "File not found"
|
92
|
+
|
93
|
+
o "Status set on ignored paths",
|
94
|
+
:ignore_status, 404
|
95
|
+
|
96
|
+
o "Enable directory listing",
|
97
|
+
:list_directories, false
|
98
|
+
|
99
|
+
o "Templating engines to load on startup",
|
100
|
+
:load_engines, nil
|
101
|
+
|
102
|
+
o "All paths to controllers are mapped here.",
|
103
|
+
:mapping, {}
|
104
|
+
|
105
|
+
o "Activate middleware",
|
106
|
+
:middleware, false
|
107
|
+
|
108
|
+
o "For your own modes to decide on",
|
109
|
+
:mode, :live, :cli => [:live, :dev]
|
110
|
+
|
111
|
+
o "The place ramaze was started from, useful mostly for debugging",
|
112
|
+
:origin, :main
|
113
|
+
|
114
|
+
o "Specify port",
|
115
|
+
:port, 7000, :short => :p, :cli => 7000
|
116
|
+
|
117
|
+
o "Specify directory to serve static files",
|
118
|
+
:public_root, "public", :cli => "public"
|
119
|
+
|
120
|
+
o "Record all Request objects by assigning a filtering Proc to me.",
|
121
|
+
:record, false
|
122
|
+
|
123
|
+
o "root directory of your application (former APPDIR)",
|
124
|
+
:root, File.dirname(File.expand_path($0))
|
125
|
+
|
126
|
+
o "Don't wait until all adapter-threads are finished or killed.",
|
127
|
+
:run_loose, false, :cli => false
|
128
|
+
|
129
|
+
o "The runner of your application (start.rb)",
|
130
|
+
:runner, "/home/manveru/c/ramaze/examples/hello.rb"
|
131
|
+
|
132
|
+
o "The running server will be put here from Adapter.",
|
133
|
+
:server, nil
|
134
|
+
|
135
|
+
o "Turn on session for all requests.",
|
136
|
+
:sessions, true, :cli => true
|
137
|
+
|
138
|
+
o "Turn on BF/DoS protection for error-responses",
|
139
|
+
:shield, false, :cli => false
|
140
|
+
|
141
|
+
o "What signal to trap to call Ramaze::shutdown",
|
142
|
+
:shutdown_trap, "SIGINT"
|
143
|
+
|
144
|
+
o "Interval in seconds of the background SourceReload",
|
145
|
+
:sourcereload, 3, :cli => 3
|
146
|
+
|
147
|
+
o "Test before start if adapters will be able to connect",
|
148
|
+
:test_connections, true, :cli => true
|
149
|
+
|
150
|
+
o "Specify directory to serve dynamic files",
|
151
|
+
:view_root, "view", :cli => "view"
|
152
|
+
end
|
153
|
+
end
|