[Catalyst-commits] r11325 - in
Catalyst-Runtime/5.80/branches/better_scripts: . lib
lib/Catalyst lib/Catalyst/Component lib/Catalyst/DispatchType
lib/Catalyst/Engine lib/Catalyst/Engine/HTTP
lib/Catalyst/Exception t t/aggregate t/author t/lib
t/lib/TestApp/Action t/lib/TestApp/Controller
t/lib/TestApp/Controller/Action t/lib/TestAppIndexDefault
t/lib/TestAppIndexDefault/Controller t/lib/TestAppNonMooseController
t/lib/TestAppNonMooseController/Controller
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Sat Sep 5 15:21:21 GMT 2009
Author: t0m
Date: 2009-09-05 15:21:21 +0000 (Sat, 05 Sep 2009)
New Revision: 11325
Added:
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component/ContextClosure.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Detach.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Go.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_index_or_default.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_anon.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_attributes.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_escaped_path.t
Catalyst-Runtime/5.80/branches/better_scripts/t/author/
Catalyst-Runtime/5.80/branches/better_scripts/t/author/optional_http-server.t
Catalyst-Runtime/5.80/branches/better_scripts/t/c3_appclass_bug.t
Catalyst-Runtime/5.80/branches/better_scripts/t/custom_exception_class_simple.t
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Anon.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/ContextClosure.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppClassExceptionSimpleTest.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Default.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexChained.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Root.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/Controller/
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/Controller/Foo.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/ControllerBase.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/live_component_controller_context_closure.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_action.t
Removed:
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP/Restarter.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP/Restarter/
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_atttributes.t
Catalyst-Runtime/5.80/branches/better_scripts/t/cdi_backcompat_plugin_accessor_override.t
Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server.t
Modified:
Catalyst-Runtime/5.80/branches/better_scripts/
Catalyst-Runtime/5.80/branches/better_scripts/Changes
Catalyst-Runtime/5.80/branches/better_scripts/MANIFEST.SKIP
Catalyst-Runtime/5.80/branches/better_scripts/Makefile.PL
Catalyst-Runtime/5.80/branches/better_scripts/TODO
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Action.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/ClassData.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Controller.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Chained.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Default.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Index.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Path.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Regex.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/CGI.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/FastCGI.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Request.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Response.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Runtime.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Stats.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Test.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Utils.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_action.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path_matchsingle.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_regexp.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_streaming.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_view_single.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_headers.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_remote_user.t
Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_uri_for_action.t
Catalyst-Runtime/5.80/branches/better_scripts/t/caf_backcompat.t
Catalyst-Runtime/5.80/branches/better_scripts/t/deprecated.t
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Action/TestMyAction.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Action.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Inheritance.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Path.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Streaming.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestPluginWithConstructor.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server-restart.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_classdata.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_component_loading.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_plugin.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_log.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_stats.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_for.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_with.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_load_catalyst_test.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_metaclass_compat_non_moose_controller.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_response.t
Catalyst-Runtime/5.80/branches/better_scripts/t/unit_stats.t
Log:
r10660 at tomas-dorans-macbook-pro (orig r10659): caelum | 2009-06-25 10:37:35 +0100
r5555 at hlagh (orig r10585): caelum | 2009-06-18 12:42:15 -0700
new branch
r5556 at hlagh (orig r10586): caelum | 2009-06-18 14:38:40 -0700
made a failing test
r5585 at hlagh (orig r10600): caelum | 2009-06-19 16:47:02 -0700
prevent actions named index from registering as an index dispatchtype if they can be registered with another dispatchtype
r5586 at hlagh (orig r10601): caelum | 2009-06-19 17:19:18 -0700
minor change
r5587 at hlagh (orig r10602): caelum | 2009-06-19 22:11:53 -0700
nicer action sorting for Path
r5595 at hlagh (orig r10604): caelum | 2009-06-20 10:18:53 -0700
minor changes
r5599 at hlagh (orig r10608): caelum | 2009-06-20 17:26:22 -0700
fix root default thingie jayk gave me, sanitize Paths at registration time better
r5601 at hlagh (orig r10610): caelum | 2009-06-20 18:06:01 -0700
forgot to add a file
r5616 at hlagh (orig r10611): caelum | 2009-06-21 19:17:29 -0700
missing / in test file
r5676 at hlagh (orig r10645): caelum | 2009-06-24 17:41:38 -0700
add C::DispatchType::_is_low_precedence
r10662 at tomas-dorans-macbook-pro (orig r10661): caelum | 2009-06-25 10:49:35 +0100
r5367 at hlagh (orig r10459): t0m | 2009-06-06 05:56:50 -0700
Branch for mo namespace handling refactor
r5368 at hlagh (orig r10460): mo | 2009-06-06 06:33:53 -0700
refactor of namespace handling
r5369 at hlagh (orig r10461): mo | 2009-06-06 06:34:42 -0700
TODO fix
r5371 at hlagh (orig r10466): mo | 2009-06-07 04:14:23 -0700
controller actions without attributes which are defined via config
r5372 at hlagh (orig r10467): mo | 2009-06-07 04:49:58 -0700
removed commented code
r5373 at hlagh (orig r10468): mo | 2009-06-07 05:28:53 -0700
Added support for ~ prefix to plugins and action classes
r5374 at hlagh (orig r10469): mo | 2009-06-07 05:36:55 -0700
Changes patches
r5686 at hlagh (orig r10655): caelum | 2009-06-24 19:22:27 -0700
cleanup TODO
r10669 at tomas-dorans-macbook-pro (orig r10668): rafl | 2009-06-26 16:26:42 +0100
Properly clean namespaces in Catalyst::Exception*.
r10670 at tomas-dorans-macbook-pro (orig r10669): rafl | 2009-06-26 16:26:56 +0100
Add a message attribute to Exception::Base.
r10671 at tomas-dorans-macbook-pro (orig r10670): rafl | 2009-06-26 16:27:05 +0100
Make exception stringify as their message.
r10672 at tomas-dorans-macbook-pro (orig r10671): rafl | 2009-06-26 16:27:19 +0100
Make Catalyst::Exception throw exception instances instead of plain strings.
r10673 at tomas-dorans-macbook-pro (orig r10672): rafl | 2009-06-26 16:27:30 +0100
Enable overloading fallback for Catalyst::Exception.
r10674 at tomas-dorans-macbook-pro (orig r10673): rafl | 2009-06-26 16:27:42 +0100
Add exception classes for the redispatching exceptions.
r10675 at tomas-dorans-macbook-pro (orig r10674): rafl | 2009-06-26 16:27:55 +0100
Throw redispatch exception objects instead of plain strings for detach and go.
r10676 at tomas-dorans-macbook-pro (orig r10675): rafl | 2009-06-26 16:28:06 +0100
Detect redispatch exceptions by a class check, not by checking the exception message.
r10677 at tomas-dorans-macbook-pro (orig r10676): rafl | 2009-06-26 16:28:14 +0100
Add a rethrow method to Exception.
r10678 at tomas-dorans-macbook-pro (orig r10677): rafl | 2009-06-26 16:28:24 +0100
Make Exception initialisation saner.
r10679 at tomas-dorans-macbook-pro (orig r10678): rafl | 2009-06-26 16:28:41 +0100
Use methods to throw exceptions, instead of passing globals to die.
r10680 at tomas-dorans-macbook-pro (orig r10679): rafl | 2009-06-26 18:11:08 +0100
Add Catalyst::Component::ContextClosure.
r10681 at tomas-dorans-macbook-pro (orig r10680): rafl | 2009-06-26 18:34:25 +0100
Add docs for ContextClosure.
r10682 at tomas-dorans-macbook-pro (orig r10681): rafl | 2009-06-26 20:45:30 +0100
Add test for ContextClosure.
r10683 at tomas-dorans-macbook-pro (orig r10682): rafl | 2009-06-26 20:45:45 +0100
Fix annoying warnings in Utils::resolve_namespace.
Also get rid of some other nits introduced with resolve_namespace.
r10685 at tomas-dorans-macbook-pro (orig r10684): rafl | 2009-06-26 20:50:14 +0100
stub pod for Exception::Go and ::Detach.
r10686 at tomas-dorans-macbook-pro (orig r10685): rafl | 2009-06-26 21:15:35 +0100
Changelogging.
r10687 at tomas-dorans-macbook-pro (orig r10686): rafl | 2009-06-26 21:31:50 +0100
Moar changelogging.
r10691 at tomas-dorans-macbook-pro (orig r10690): rafl | 2009-06-27 14:26:01 +0100
Bump deps for test aggregation.
r10692 at tomas-dorans-macbook-pro (orig r10691): rafl | 2009-06-27 14:26:20 +0100
Apply method modifier to capture $ctx for ctx_request to the tested app, not Catalyst itself.
Also get rid of some trailing whitespace added with ctx_request.
r10693 at tomas-dorans-macbook-pro (orig r10692): rafl | 2009-06-27 14:56:36 +0100
Don't screw the prove -l user too hard.
r10700 at tomas-dorans-macbook-pro (orig r10699): rafl | 2009-06-28 15:58:16 +0100
Pass $c along to path_prefix in _parse_PathPrefix_attr.
This prevents things from blowing up if the controller instance doesn't know
about its action namespace already, when the attribute value is being parsed.
Closes RT#42816. Courtesy of Jason Kohles.
r10701 at tomas-dorans-macbook-pro (orig r10700): t0m | 2009-06-28 17:12:31 +0100
Add a TODO test for matching url encoded paths from RT#34525
r10702 at tomas-dorans-macbook-pro (orig r10701): t0m | 2009-06-28 17:45:21 +0100
Make Test::Aggregate not puke due to weird character at the start of the file
r10703 at tomas-dorans-macbook-pro (orig r10702): t0m | 2009-06-28 17:54:40 +0100
And unfuck test by calling ->handle_request correctly. Only showed up under Test::Aggregate, weird
r10704 at tomas-dorans-macbook-pro (orig r10703): t0m | 2009-06-28 17:58:01 +0100
Twinking. That around modifier offended me, as I wrote the code to inline accessors like that..
r10721 at tomas-dorans-macbook-pro (orig r10720): t0m | 2009-06-29 00:45:59 +0100
Fix bug from RT#46459, misc cleanups in Catalyst::Test
r10726 at tomas-dorans-macbook-pro (orig r10725): caelum | 2009-06-29 17:49:44 +0100
remove Action::sort_order
r10727 at tomas-dorans-macbook-pro (orig r10726): caelum | 2009-06-29 17:54:55 +0100
remove cmp overload in Action
r10729 at tomas-dorans-macbook-pro (orig r10728): caelum | 2009-06-29 18:06:21 +0100
add note about overloaded <=>
r10730 at tomas-dorans-macbook-pro (orig r10729): t0m | 2009-06-29 20:57:17 +0100
Comment the magic so that someone doesn't just remove it again.
r10731 at tomas-dorans-macbook-pro (orig r10730): rafl | 2009-06-29 23:05:02 +0100
Remove <=> overloading for actions.
r10732 at tomas-dorans-macbook-pro (orig r10731): rafl | 2009-06-29 23:05:12 +0100
Remove useless asignment.
r10733 at tomas-dorans-macbook-pro (orig r10732): rafl | 2009-06-29 23:05:25 +0100
Actually use make_context_closure correctly in the tests.
r10734 at tomas-dorans-macbook-pro (orig r10733): rafl | 2009-06-29 23:05:36 +0100
Disable ContextClosure tests with LeakCheckers that aren't based on Devel::Cycle.
It's not on cpan yet, but will be as soon as a new Devel::Cycle is released.
r10735 at tomas-dorans-macbook-pro (orig r10734): rafl | 2009-06-29 23:05:48 +0100
Version 0.80006.
r10737 at tomas-dorans-macbook-pro (orig r10736): t0m | 2009-06-30 00:17:47 +0100
Don't mangle query parameters passed to uri_for, the list
r10740 at tomas-dorans-macbook-pro (orig r10739): edenc | 2009-06-30 16:13:45 +0100
added test case + patch for inherited action configuration
r10741 at tomas-dorans-macbook-pro (orig r10740): edenc | 2009-06-30 16:21:22 +0100
updated Changes
r10742 at tomas-dorans-macbook-pro (orig r10741): gphat | 2009-06-30 16:24:37 +0100
Add new uri_with mode for appending.
r10743 at tomas-dorans-macbook-pro (orig r10742): gphat | 2009-06-30 16:25:45 +0100
Claim my work, in case it breaks. ;)
r10744 at tomas-dorans-macbook-pro (orig r10743): t0m | 2009-06-30 18:28:18 +0100
Mangle changelog to remove names. Note mangling goes back to 5.32, but tough - I'm not doing it manually
r10747 at tomas-dorans-macbook-pro (orig r10746): t0m | 2009-06-30 21:35:40 +0100
Core fix for warnings due to undef body as per fix in FillInForm in r10745
r10756 at tomas-dorans-macbook-pro (orig r10755): rafl | 2009-06-30 22:26:15 +0100
Pretend that Catalyst.pm does Component::ApplicationAttribute.
r10757 at tomas-dorans-macbook-pro (orig r10756): rafl | 2009-06-30 22:30:38 +0100
Changelogging.
r10758 at tomas-dorans-macbook-pro (orig r10757): t0m | 2009-06-30 22:42:11 +0100
Test case for a way to make C3 crap itself by partially using Moose + fix.
r10759 at tomas-dorans-macbook-pro (orig r10758): t0m | 2009-06-30 22:57:12 +0100
Add missed bug fixes to changelog
r10760 at tomas-dorans-macbook-pro (orig r10759): rafl | 2009-06-30 23:09:48 +0100
Version 5.80007.
r10781 at tomas-dorans-macbook-pro (orig r10780): rafl | 2009-07-04 00:31:33 +0100
Merge branch 'author_requires'
* author_requires:
Port to Module::Install::AuthorRequires.
Create branch author_requires
r10782 at tomas-dorans-macbook-pro (orig r10781): rafl | 2009-07-04 00:31:45 +0100
Merge branch 'check_conflicts'
* check_conflicts:
Port to Module::Install::CheckConflicts.
Create branch check_conflicts
Conflicts:
Makefile.PL
r10783 at tomas-dorans-macbook-pro (orig r10782): rafl | 2009-07-04 00:31:59 +0100
Stop writing META.yml twice.
r10784 at tomas-dorans-macbook-pro (orig r10783): rafl | 2009-07-04 00:34:21 +0100
Only call author_requires once, so all missing author deps are reported at once.
r10785 at tomas-dorans-macbook-pro (orig r10784): rafl | 2009-07-04 00:52:44 +0100
Unfuck indenting.
r10802 at tomas-dorans-macbook-pro (orig r10801): t0m | 2009-07-05 23:51:39 +0100
Fix warning, and only warn if really needed
r10824 at tomas-dorans-macbook-pro (orig r10823): autarch | 2009-07-07 21:58:31 +0100
Deleted the old Restarter and associated code.
Also removed the dep on File::Modified
r10831 at tomas-dorans-macbook-pro (orig r10830): t0m | 2009-07-08 21:11:57 +0100
U R DOIN IT WRONG.
r10836 at tomas-dorans-macbook-pro (orig r10835): t0m | 2009-07-08 23:12:29 +0100
More ->config fixes + Changelog
r10852 at tomas-dorans-macbook-pro (orig r10851): t0m | 2009-07-11 13:51:07 +0100
Less lies in the deprecated block comment in Dispatcher.pm as it's throwing people off
r10862 at tomas-dorans-macbook-pro (orig r10861): groditi | 2009-07-11 23:07:47 +0100
private_path method for actions that returns a string suitable for use in forward and unit tests for the rest of catalyst::Action
r10865 at tomas-dorans-macbook-pro (orig r10864): t0m | 2009-07-12 01:56:51 +0100
Fix test
r10866 at tomas-dorans-macbook-pro (orig r10865): t0m | 2009-07-12 01:57:19 +0100
Refactor to remove warning
r10885 at tomas-dorans-macbook-pro (orig r10884): t0m | 2009-07-14 21:25:03 +0100
Fix Makefile.PL to actually do the right thing on Lepoard (alledgedly), and encourage someone to contribute to maintaining our protection against Apple :)
r10892 at tomas-dorans-macbook-pro (orig r10891): dandv | 2009-07-16 02:12:59 +0100
Fixed POD links to get and request
r10893 at tomas-dorans-macbook-pro (orig r10892): dandv | 2009-07-16 06:24:10 +0100
Could not have made a more insignificant patch
r10898 at tomas-dorans-macbook-pro (orig r10897): t0m | 2009-07-16 22:05:25 +0100
Special move for CX::Component::Traits. No tests, please don't look.
r10899 at tomas-dorans-macbook-pro (orig r10898): t0m | 2009-07-16 22:12:49 +0100
Remove 10897, this hack kinda works, but then leads to more issues. Gonna branch
r10900 at tomas-dorans-macbook-pro (orig r10899): t0m | 2009-07-16 22:24:11 +0100
Write that down
r10915 at tomas-dorans-macbook-pro (orig r10914): dandv | 2009-07-17 06:18:22 +0100
Hyperlinked POD entry for Catalysy::Request->args
r10941 at tomas-dorans-macbook-pro (orig r10940): jester | 2009-07-22 13:46:29 +0100
Changed link from C::Base to C::Controller; fixed my alias
r10962 at tomas-dorans-macbook-pro (orig r10961): hobbs | 2009-07-23 05:46:43 +0100
Depend on Module::Pluggable 3.9 to resolve a bug with inner packages in tests.
r10963 at tomas-dorans-macbook-pro (orig r10962): hobbs | 2009-07-23 10:32:08 +0100
Test and Changelog entry for r10961.
r10981 at tomas-dorans-macbook-pro (orig r10980): t0m | 2009-07-25 22:05:19 +0100
Remove dead and unused method
r10985 at tomas-dorans-macbook-pro (orig r10984): autarch | 2009-07-26 03:14:23 +0100
fix spelling of attributes in the test name
r10986 at tomas-dorans-macbook-pro (orig r10985): dandv | 2009-07-26 08:13:19 +0100
Fixed a bunch of POD hyperlinks in Catalyst.pm and minor punctuation in Catalyst::Action
r10994 at tomas-dorans-macbook-pro (orig r10993): kmx | 2009-07-28 16:26:44 +0100
C::Engine::FastCGI (_fix_env) - Microsoft IIS on Windows 2008 R2 has version string "IIS/7.5" that was not supported; this patch makes test condition more general, accepting versions from IIS/6.0 to IIS/9.9 (should be enough for a while)
r10995 at tomas-dorans-macbook-pro (orig r10994): hobbs | 2009-07-29 01:33:25 +0100
Rewrite the POD for $c->uri_for().
Reintroduce some bits of information that were lost in 5.7->5.8, and remove
a misleading statement about $c->action. Recommend the use of uri_for_action
with a private action path.
r10996 at tomas-dorans-macbook-pro (orig r10995): hobbs | 2009-07-29 01:59:19 +0100
Update Changes and add me to Contributors
r10997 at tomas-dorans-macbook-pro (orig r10996): hobbs | 2009-07-29 02:06:09 +0100
Add konobi to contributors
r10998 at tomas-dorans-macbook-pro (orig r10997): hobbs | 2009-07-29 02:35:11 +0100
Changes entry for r10993
r11009 at tomas-dorans-macbook-pro (orig r11008): t0m | 2009-07-30 15:31:26 +0100
Add to TODO so I don't have to grep backlog later when I have tuits
r11013 at tomas-dorans-macbook-pro (orig r11012): t0m | 2009-07-31 02:46:00 +0100
Large TODO update
r11019 at tomas-dorans-macbook-pro (orig r11018): t0m | 2009-08-01 01:39:39 +0100
Merge branch pass_component_names:
svn merge -r 10899:10927 http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/5.80/branches/pass_component_names
r11021 at tomas-dorans-macbook-pro (orig r11020): t0m | 2009-08-01 03:00:23 +0100
Aww, crap, fail. merge 10927:HEAD from pass_component_names
r11024 at tomas-dorans-macbook-pro (orig r11023): caelum | 2009-08-01 20:04:08 +0100
allow uri_for($controller_instance)
r11035 at tomas-dorans-macbook-pro (orig r11034): t0m | 2009-08-05 20:39:01 +0100
Require perl 5.8.6
r11038 at tomas-dorans-macbook-pro (orig r11037): hobbs | 2009-08-06 10:57:02 +0100
Add a method to the stats object to get the request start time.
r11048 at tomas-dorans-macbook-pro (orig r11047): t0m | 2009-08-07 01:15:04 +0100
Fix the perl version required there also
r11049 at tomas-dorans-macbook-pro (orig r11048): t0m | 2009-08-07 01:24:17 +0100
Blow up if we're in author mode and don't have the right M::I extensions
r11050 at tomas-dorans-macbook-pro (orig r11049): t0m | 2009-08-07 01:57:21 +0100
Bump MX::MA dep for anon class tests
r11058 at tomas-dorans-macbook-pro (orig r11057): gbjk | 2009-08-07 17:45:03 +0100
DispatchType::Chained fix for default args attribute to handle Args(0) vs Args() at depth.
r11059 at tomas-dorans-macbook-pro (orig r11058): gbjk | 2009-08-07 18:17:15 +0100
DispatchType::Chained fix failing test of Args(0) vs Args(0) on surface
r11062 at tomas-dorans-macbook-pro (orig r11061): gbjk | 2009-08-07 22:17:22 +0100
Engine::HTTP - Fix paths for HTTP requests with scheme and domain in URI.
r11064 at tomas-dorans-macbook-pro (orig r11063): groditi | 2009-08-08 22:54:04 +0100
make debug output prettier with large widths
r11065 at tomas-dorans-macbook-pro (orig r11064): groditi | 2009-08-08 22:54:46 +0100
oops debug output got leaked in
r11069 at tomas-dorans-macbook-pro (orig r11068): t0m | 2009-08-09 13:36:20 +0100
Fix RT#48555
r11070 at tomas-dorans-macbook-pro (orig r11069): t0m | 2009-08-09 13:36:55 +0100
Updates changelog
r11071 at tomas-dorans-macbook-pro (orig r11070): t0m | 2009-08-09 15:22:21 +0100
Rewrite fixes for RT#48555
r11123 at tomas-dorans-macbook-pro (orig r11122): t0m | 2009-08-11 22:49:37 +0100
Unfuck Catalyst::View::JSON
r11125 at tomas-dorans-macbook-pro (orig r11124): t0m | 2009-08-11 23:32:47 +0100
Apply patch from RT#48623 to fix headers in Engine::HTTP
r11127 at tomas-dorans-macbook-pro (orig r11126): rjbs | 2009-08-12 00:33:18 +0100
svn merge -r 11123:11125 branches/locate_components/ trunk/
r11128 at tomas-dorans-macbook-pro (orig r11127): rjbs | 2009-08-12 00:34:12 +0100
add changelog entry for merged locate_components branch
r11130 at tomas-dorans-macbook-pro (orig r11129): t0m | 2009-08-12 01:15:51 +0100
Tiny change to make the error make more sense
r11132 at tomas-dorans-macbook-pro (orig r11131): t0m | 2009-08-12 02:09:09 +0100
Split test out into a more proper app, so that the test no longer relies on the metaclass initialization hacking occurring in ->setup_component, as I want to move it
r11133 at tomas-dorans-macbook-pro (orig r11132): t0m | 2009-08-12 02:11:07 +0100
Blow up rather than failing to call ->can if everything is totally screwed
r11134 at tomas-dorans-macbook-pro (orig r11133): rafl | 2009-08-12 03:54:52 +0100
Fix POD refering to CGI::Cookie. We're using CGI::Simple::Cookie.
Courtesy of Forrest Cahoon.
r11135 at tomas-dorans-macbook-pro (orig r11134): t0m | 2009-08-12 12:03:06 +0100
Make the code much clearer about what is going on, and remove the horrible map and grep which I hated.
r11140 at tomas-dorans-macbook-pro (orig r11139): rafl | 2009-08-16 10:19:58 +0100
Do at least one (possibly empty) write when reading the response body from a filehandle.
r11145 at tomas-dorans-macbook-pro (orig r11144): jshirley | 2009-08-17 22:33:17 +0100
Adding and documented X-Forwarded-Port
r11146 at tomas-dorans-macbook-pro (orig r11145): t0m | 2009-08-17 23:08:19 +0100
Capitalisation fixes in Changelog
r11147 at tomas-dorans-macbook-pro (orig r11146): t0m | 2009-08-17 23:11:34 +0100
Add _component_name stuff to Changes
r11148 at tomas-dorans-macbook-pro (orig r11147): jshirley | 2009-08-17 23:13:05 +0100
Conflict resolution
r11149 at tomas-dorans-macbook-pro (orig r11148): hobbs | 2009-08-17 23:24:46 +0100
Changelog for r11037
r11150 at tomas-dorans-macbook-pro (orig r11149): t0m | 2009-08-18 00:14:38 +0100
Switch to catalyst_component_name
r11154 at tomas-dorans-macbook-pro (orig r11153): ferz | 2009-08-18 07:55:14 +0100
Test case using Exception::Class
r11155 at tomas-dorans-macbook-pro (orig r11154): ferz | 2009-08-18 12:19:40 +0100
drop POD comments.
r11166 at tomas-dorans-macbook-pro (orig r11165): t0m | 2009-08-19 20:03:01 +0100
Move test to make more sense in my idea of the naming scheme - t/dead_ is for tests which check the app pukes, which this shouldn't
r11167 at tomas-dorans-macbook-pro (orig r11166): t0m | 2009-08-19 20:04:59 +0100
Fail commit was fail. Back out the part I didn't want
r11168 at tomas-dorans-macbook-pro (orig r11167): t0m | 2009-08-19 20:10:06 +0100
Remove r11058 - the commit message is lies, it does not fix the TODO test
r11169 at tomas-dorans-macbook-pro (orig r11168): t0m | 2009-08-19 21:21:44 +0100
Back out r11057 which breaks one of the chained tests, whilst not fixing the bug in question
r11170 at tomas-dorans-macbook-pro (orig r11169): t0m | 2009-08-19 21:29:16 +0100
Clean up test app for the exception test, as we don't want to depend on Test::Class thanks
r11171 at tomas-dorans-macbook-pro (orig r11170): rafl | 2009-08-19 21:45:45 +0100
Changelog Engine::finalize_body changes.
r11181 at tomas-dorans-macbook-pro (orig r11180): gbjk | 2009-08-21 14:07:54 +0100
Changelog update for previous Catalyst::Engine::HTTP fix.
r11182 at tomas-dorans-macbook-pro (orig r11181): rafl | 2009-08-21 16:51:26 +0100
Now we don't have the broken restarter engine anymore, we conflict with old Catalyst::Devel versions, that don't have the new restarter yet.
r11183 at tomas-dorans-macbook-pro (orig r11182): rafl | 2009-08-21 17:12:57 +0100
Conflict with the latest mason view, which blows up because of the new component_name constructor arg.
r11184 at tomas-dorans-macbook-pro (orig r11183): rafl | 2009-08-21 17:13:05 +0100
Version 5.80008.
r11190 at tomas-dorans-macbook-pro (orig r11189): t0m | 2009-08-21 20:54:58 +0100
Fix and tests for big issue in 5.80008
r11191 at tomas-dorans-macbook-pro (orig r11190): rafl | 2009-08-21 21:28:30 +0100
Version 5.80009.
r11193 at tomas-dorans-macbook-pro (orig r11192): rafl | 2009-08-21 21:55:25 +0100
DOH! do more than one read, if necessary.
r11194 at tomas-dorans-macbook-pro (orig r11193): rafl | 2009-08-21 22:22:36 +0100
Do what we want instead of exiting a sub via last.
r11195 at tomas-dorans-macbook-pro (orig r11194): rafl | 2009-08-21 22:22:45 +0100
Add test for sending the body from a filehandle with more data than the default chunksize of 64k.
r11196 at tomas-dorans-macbook-pro (orig r11195): rafl | 2009-08-21 22:31:38 +0100
Changelogging.
r11197 at tomas-dorans-macbook-pro (orig r11196): rafl | 2009-08-21 22:41:05 +0100
Version 5.80010.
r11215 at tomas-dorans-macbook-pro (orig r11214): rafl | 2009-08-22 20:56:53 +0100
Remove leftovers of the restarter engine.
The removed code caused test failures, which weren't apparent due to installed
copies still being available in everyone's @INC.
r11218 at tomas-dorans-macbook-pro (orig r11217): rafl | 2009-08-23 12:46:42 +0100
Changelogging.
r11219 at tomas-dorans-macbook-pro (orig r11218): rafl | 2009-08-23 12:55:48 +0100
Version 5.80011.
r11221 at tomas-dorans-macbook-pro (orig r11220): rafl | 2009-08-23 19:42:17 +0100
Failing test for component loading
r11233 at tomas-dorans-macbook-pro (orig r11232): t0m | 2009-08-24 13:51:03 +0100
Test fixes for if CATALYST_DEBUG is set to 1.
r11239 at tomas-dorans-macbook-pro (orig r11238): t0m | 2009-08-25 12:25:54 +0100
0003-Remove-diag-message.patch (marcus)
r11240 at tomas-dorans-macbook-pro (orig r11239): t0m | 2009-08-25 12:26:15 +0100
Fix duplicate components
r11252 at tomas-dorans-macbook-pro (orig r11251): frew | 2009-08-26 20:00:01 +0100
Look! I'm famous! (See Catalyst-Devel)
r11254 at tomas-dorans-macbook-pro (orig r11253): dandv | 2009-08-27 01:56:26 +0100
POD addition: $c->req->body returns a string or a File::Temp object
r11278 at tomas-dorans-macbook-pro (orig r11277): t0m | 2009-09-01 02:07:23 +0100
Nuke skipped test which will never pass
r11279 at tomas-dorans-macbook-pro (orig r11278): t0m | 2009-09-01 02:07:47 +0100
Author tests
r11280 at tomas-dorans-macbook-pro (orig r11279): t0m | 2009-09-01 02:09:29 +0100
t/author in MANFEST
r11281 at tomas-dorans-macbook-pro (orig r11280): t0m | 2009-09-01 02:10:46 +0100
Stop remote tests breaking everything, and force authors to run some remote tests.
r11282 at tomas-dorans-macbook-pro (orig r11281): t0m | 2009-09-01 02:11:33 +0100
Stop calling class data methods on instances + commented out warning
r11283 at tomas-dorans-macbook-pro (orig r11282): t0m | 2009-09-01 02:11:45 +0100
Changelog
r11300 at tomas-dorans-macbook-pro (orig r11292): t0m | 2009-09-01 15:11:05 +0100
Bump versions back to 5.8.4
r11301 at tomas-dorans-macbook-pro (orig r11293): t0m | 2009-09-01 15:32:46 +0100
Changes tweaks
r11307 at tomas-dorans-macbook-pro (orig r11299): t0m | 2009-09-02 03:03:58 +0100
Changelogging
Property changes on: Catalyst-Runtime/5.80/branches/better_scripts
___________________________________________________________________
Name: svk:merge
- 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:10614
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
+ 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:11299
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
Modified: Catalyst-Runtime/5.80/branches/better_scripts/Changes
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/Changes 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/Changes 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,21 +1,162 @@
# This file documents the revision history for Perl extension Catalyst.
Bug fixes:
- - Revert change to URL encode things passed into $c->uri_for
- Args and CaptureArgs as this causes breakage to pre-existing
- applications.
- - Remove use of Test::MockObject as it doesn't install from CPAN
- in some environments.
- - Remove use of dclone to deep copy configs and replace with
- Catalyst::Utils::merge_hashes which has the same effect, of
- ensuring child classes don't inherit their parent's config,
- except works correctly with closures.
+ - Fix t/optional_http-server.t test.
+ - Fix t/optional_http-server-restart.t test.
+ - Fix duplicate components being loaded at setup time, each component is
+ now loaded at most once + tests.
+ Refactoring / cleanups:
+ - Reduce minimum supported perl version from 5.8.6 to 5.8.4 as there are
+ many people still running/testing this version with no known issues.
+
+ Tests:
+ - Make the optional_http_server.t test an author only test which must be
+ run by authors to stop it being broken again.
+ - Fix recursion warnings in the test suites.
+
+5.80011 2009-08-23 13:48:15
+
+ Bug fixes:
+ - Remove leftovers of the restarter engine. The removed code caused test
+ failures, which weren't apparent for anyone still having an old version
+ installed in @INC.
+
+5.80010 2009-08-21 23:32:15
+
+ Bug fixes:
+ - Fix and add tests for a regression introduced by 5.80008.
+ Catalyst::Engine is now able to send out data from filehandles larger
+ than the default chunksize of 64k again.
+
+5.80009 2009-08-21 22:21:08
+
+ Bug fixes:
+ - Fix and add tests for generating inner packages inside the COMPONENT
+ method, and those packages being correctly registered as components.
+ This fixes Catalyst::Model::DBIC among others.
+
+5.80008 2009-08-21 17:47:30
+
+ Bug fixes:
+ - Fix replace_constructor warning to actually work if you make your
+ application class immutable without that option.
+ - Depend on Module::Pluggable 3.9 to prevent a bug wherein components
+ in inner packages might not be registered. This especially affected
+ tests.
+ - Catalyst::Engine::FastCGI - relax the check for versions of Microsoft
+ IIS. Provides compatibility with Windows 2008 R2 as well as
+ (hopefully) future versions.
+ - In tests which depend on the values of environment variables,
+ localise the environment, then delete only relevant environment
+ variables (RT#48555)
+ - Fix issue with Engine::HTTP not sending headers properly in some cases
+ (RT#48623)
+ - Make Catalyst::Engine write at least once when finalizing the response
+ body from a filehandle, even if the write is empty. This avoids fail
+ when trying to send out an empty response body from a filehandle.
+ - Catalyst::Engine::HTTP - Accept a fully qualified absolute URI in the
+ Request-URI of the Request-Line
+
+ Refactoring / cleanups:
+ - Deleted the Restarter engine and its Watcher code. Use the
+ new Catalyst::Restarter in a recent Catalyst::Devel instead.
+ - New unit test for Catalyst::Action 'unit_core_action.t'
+ - Bump minimum supported perl version from 5.8.1 to 5.8.6 as there are
+ known issues with 5.8.3.
+ - Debug output uses dynamic column sizing to create more readable output
+ when using a larger $ENV{COLUMNS} setting. (groditi)
+
+ New features:
+ - Added private_path method for Catalyst::Action
+ - Allow uri_for($controller_instance) which will produce a URI
+ for the controller namespace
+ - Break setup_components into two more parts: locate_components and
+ expand_component_module (rjbs)
+ - Allow Components to return anon classed from their COMPONENT method
+ correctly, and have action registration work on Controllers returned
+ as such by adding a catalyst_component_name accessor for all components
+ which returns the component instance's name to be used when building
+ actions etc.
+ - Adding X-Forwarded-Port to allow the frontend proxy to dictate the
+ frontend port (jshirley)
+ - Added Catalyst::Stats->created accessor for the time at the start of
+ the request.
+
+ Documentation:
+ - Fix POD to refer to ->config(key => $val), rather than
+ ->config->{key} = $val, as the latter form is deprecated.
+ - Clearer docs for the 'uri_for' method.
+ - Fix POD refering to CGI::Cookie. We're using CGI::Simple::Cookie.
+ (Forrest Cahoon)
+
+5.80007 2009-06-30 23:54:34
+
+ Bug fixes:
+ - Don't mangle query parameters passed to uri_for
+ - Tests for this (Byron Young + Amir Sadoughi)
+ - Inherited controller methods can now be specified in
+ config->{action(s)}
+ - Assigning an undef response body no longer produces warnings
+ - Fix C3 incompatibility bug caused if you use Moose in MyApp.pm and
+ add Catalyst to the right hand side of this in @ISA.
+ - Make Catalyst.pm implement the Component::ApplicationAttribute
+ interface so defining actions in MyApp.pm works again, if the
+ actions have attributes that cause $self->_application to be used
+ (like ActionClass).
+
+ New features:
+ - Add optional second argument to uri_with which appends to existing
+ params rather than replacing them. (foo=1 becomes foo=1&foo=2 when
+ uri_with({ foo => 2 }, { mode => 'append' }) is called on a foo=1
+ URI.
+
+5.80006 2009-06-29 23:37:47
+
+ Bug fixes:
+ - Revert change to URL encode things passed into $c->uri_for
+ Args and CaptureArgs as this causes breakage to pre-existing
+ applications.
+ - Remove use of Test::MockObject as it doesn't install from CPAN
+ in some environments.
+ - Remove use of dclone to deep copy configs and replace with
+ Catalyst::Utils::merge_hashes which has the same effect, of
+ ensuring child classes don't inherit their parent's config,
+ except works correctly with closures.
+ - Add Class::C3::reinitialize into Catalyst::Test to avoid weird
+ bugs in ctx_request (bokutin in RT#46459)
+ - Fix issues with _parse_PathPrefix_attr method in Catalyst::Controller
+ (jasonk in RT#42816)
+ - Fix bugs with action sorting:
+ - Path actions sorted so that the most specific wins.
+ - Action methods named default and index fixed.
+
+ New features:
+ - Use ~ as prefix for plugins or action classes which are located in
+ MyApp::Plugin / MyApp::Action (mo)
+ - Controller methods without attributes are now considered actions if
+ they are specified in config->{action(s)} (mo)
+ - Add Catalyst::Component::ContextClosure as an easy way to create code
+ references, that close over the context, without creating leaks.
+
+ Refactoring / cleanups:
+ - Clean namespaces in Catalyst::Exception*.
+ - Turn Catalyst::Exception into an actual class and make the throw
+ method create instances of it. They can still be used as normal
+ strings, as before, as they are overloaded to stringify to their
+ error message.
+ - Add a rethrow method to Catalyst::Exception.
+ - Add Catalyst::Exception::Detach and ::Go, and refactor detach() and
+ go() to use them instead of magic, global strings.
+ Fixes RT#47366
+ - Clean up getting metaclass instance and making app class immutable
+ again in Catalyst::Test
+
5.80005 2009-06-06 14:40:00
Behaviour changes:
- Arguments ($c->req->args) in Chained dispatch are now automatically
- URL decoded to be consistent with Local/Path dispatch (Caelum)
+ URL decoded to be consistent with Local/Path dispatch
Documentation:
- Clarify correct techniques for Moose controllers (domm)
@@ -24,13 +165,13 @@
- Further change pushing 'env' attribute down into Catalyst::Engine
to make $c->engine->env work in all cases (kmx)
- Also fix $c->engine->env in Catalyst::Test tests (kmx)
- - Tests for this (t0m)
+ - Tests for this
- Fix Catalyst failing to start if any plugin changed $_ whilst
- loading (t0m)
+ loading
- Tests for this
- Be stricter about arguments to Args attributes for Chained actions,
so that they blow up on load instead of causing undefined behavior
- later on (hdp)
+ later on
- Tests for this
- Prefer Path actions with a smaller (or set) number of Args (caelum)
Bug reported here: http://stackoverflow.com/questions/931653/catalyst-action-that-matches-a-single-file-in-the-root-directory/933181#933181
@@ -48,56 +189,56 @@
_controller_actions to avoid name clashes with application
controller naming. (random)
- Test for using Moose in components which have a non-Moose base class
- Fixed by 349cda in Moose 0.78 (t0m)
+ Fixed by 349cda in Moose 0.78
- Fix deprecation message for Catalyst::Dispatcher to refer
- to the class actually calling the deprecated method. RT#45741 (t0m)
+ to the class actually calling the deprecated method. RT#45741
- Clarify limitations of $request->base and $request->secure.
(Phil Mitchell)
- Add 'use Catalyst' to documentation for a Moose MyApp class as
- noted by dmaki. (t0m)
+ noted by dmaki.
- Fix so that / (and other special characters) are URL encoded when
- passed into $c->uri_for as Args/CaptureArgs (t0m)
+ passed into $c->uri_for as Args/CaptureArgs
- Fix development server so that $c->engine->env returns the correct
- environment (t0m)
- - Require Moose 0.78 to fix metaclass incompatibility issues (t0m)
+ environment
+ - Require Moose 0.78 to fix metaclass incompatibility issues
- Require MooseX::MethodAttributes 0.10 and use
Moose::Meta::Class->initialize rather than Moose->init_meta to fix
- bugs related to having a 'meta' method in your controller (t0m)
+ bugs related to having a 'meta' method in your controller
- Fix cases where your application failing to compile could cause perl
- to report 'Unknown Error' (t0m)
+ to report 'Unknown Error'
- Support adding Moose::Roles to the plugin list. These are applied to
- MyApp after plugins have been pushed onto @ISA (t0m)
+ MyApp after plugins have been pushed onto @ISA
- Fix calling $c->req->parameters as the first thing you do when
- parse_on_demand is on (t0m)
+ parse_on_demand is on
5.80003 2009-04-29 16:23:53
- Various POD tweaks. (hdp, dandv)
- - Fix formatting error in the regex fallback warning. (rafl)
+ - Fix formatting error in the regex fallback warning.
- Convert the dispatcher's and restarter engine's BUILD method to
attribute builders to not override the BUILD method from
- MooseX::Emulate::Class::Accessor::Fast. (rafl)
+ MooseX::Emulate::Class::Accessor::Fast.
- Fix classes without metaclasses restarting, when not using
- B::Hooks::OP::Check::StashChange (t0m)
+ B::Hooks::OP::Check::StashChange
- Fix the unattached chain debug table for endpoints with no
- parents at all. (rafl)
+ parents at all.
- Turn of test aggregation by default. Only aggregate if the
AGGREGATE_TESTS environment variable is set and a recent
- Test::Aggregate is available. (rafl)
+ Test::Aggregate is available.
- Bump to MooseX::MethodAttributes 0.09, to gain the
get_nearest_methods_with_attributes method allowing methods without
attributes in a subclass to override those with attributes in a
superclass. This fixes CatalystX::CRUD's method of overriding /
- disabling functionality from base controllers. (t0m)
- - Bump HTTP::Request::AsCGI dependency to avoid broken version (t0m)
+ disabling functionality from base controllers.
+ - Bump HTTP::Request::AsCGI dependency to avoid broken version
- Bump Moose dependency to latest version to fix metaclass
- incompatibility issues in some cases. (t0m)
- - Additional tests for setup_stats method. (t0m)
- - Fix log levels in Catalyst::Log to be properly additive. (t0m)
- - Fix RT#43375 by sorting results before testing them (t0m)
+ incompatibility issues in some cases.
+ - Additional tests for setup_stats method.
+ - Fix log levels in Catalyst::Log to be properly additive.
+ - Fix RT#43375 by sorting results before testing them
- Fixes for uri_for_action when using Catalyst::DispatchType::Regex
+ tests from RT#39369 (norbi)
- Partial rewrite and reoganisation of the C3 docs in
- Catalyst::Upgrading based on feedback from kiffin (t0m)
+ Catalyst::Upgrading based on feedback from kiffin
- If you make your application class immutable and turn off
constructor inlining, Catalyst will die and tell you pass
the (replace_constructor => 1) argument to
@@ -107,27 +248,27 @@
- Fix CATALYST_DEBUG and MYAPP_DEBUG environment variables
turning debuging on if defined, rather than if set.
They now force debugging on or off, taking precedence over
- configuration in your application. (t0m)
- - Tests for this (t0m)
+ configuration in your application.
+ - Tests for this
- pass replace_constructor to the immutable call to ensure
applications get a Moose constructor rather than a C::A one
- Fix issues with restarting the application class due to C3 failures
- on perl 5.10 (t0m)
+ on perl 5.10
- Work around issues in Moose with initialization order of multiple
- levels of non-Moose classes inheriting from a Moose class (t0m)
+ levels of non-Moose classes inheriting from a Moose class
- Test for this
- Add backwards compatibility method for Catalyst::Log->body, which
- has been made private (t0m)
+ has been made private
- Fix so that calling $c->req->parameters(undef) does not flatten
- the request parameters with undef + test (t0m)
+ the request parameters with undef + test
- Fix so that width of table of unattached actions for debugging
::DispatchType::Chained varies according to your terminal width
(Oleg Kostyuk)
- Fix warning message about linearized @ISA in Catalyst::Component
(Emanuele Zeppieri)
- Require MX::MethodAttributes 0.06 to avoid issues with saying
- use base 'Catalyst::Controller'; use Moose; losing actions (t0m)
- - Fix all of t0m's typos in ::Upgrading and ::Delta (hobbs)
+ use base 'Catalyst::Controller'; use Moose; losing actions
+ - Fix all of's typos in ::Upgrading and ::Delta (hobbs)
5.80001 2009-04-18 22:18
- Don't inline the constructor for Catalyst::Log to avoid a
@@ -138,89 +279,88 @@
- Test uri_with clears query params when they are set to undef
(Ian Wells)
- Complain about old Catalyst::Devel versions which generated
- ->setup(qw/-Debug... etc. as this is not recommended (t0m)
+ ->setup(qw/-Debug... etc. as this is not recommended
5.8000_07 2009-04-12 13:37
- Add the Catalyst::Dispatcher->dispatch_type method (ash)
- Throw an exception rather than loading an app if an action
- tries to chain to itself (t0m)
+ tries to chain to itself
- Tests for this
- Change the $c->visit and $c->go methods to optionally take
- CaptureArgs, making them useful to call ActionChains with (t0m)
+ CaptureArgs, making them useful to call ActionChains with
- Tests for this (radek)
- Fix _invoke_as_component method to find the proper action instance
for dispatchable actions so that ->visit or ->going to ActionChains
- with qw/Class::Name method_name/ works correctly (t0m)
+ with qw/Class::Name method_name/ works correctly
- Tests for this (radek)
- Added Catalyst::Test::ctx_request to be able to inspect
the context object after a request is made (Jos Boumans)
- debug() POD rewrite (jhannah)
- Change the warning when you have conflicting components to
- present a list (t0m)
+ present a list
- Move NEXT use and testing deprecated features out to its own
test application so that the main TestApp isn't polluted with
- spurious warnings (t0m)
- - Add a warning for the old ::[MVC]:: style naming scheme (t0m)
- - Test for this (t0m)
+ spurious warnings
+ - Add a warning for the old ::[MVC]:: style naming scheme
+ - Test for this
- Kill Class::C3::Adopt::NEXT warnings for the Catalyst:: namespace
- in production versions (t0m)
+ in production versions
- Tidy up Catalyst::ClassData to ensure that all components get
- the correct metaclass (t0m)
+ the correct metaclass
- Make MyApp.pm restartable by unsetting setup_finished in
- the restarter process (t0m)
+ the restarter process
- Non-naive implementation of making mutable on restart using
- B::Hooks::OP::Check::StashChange if installed (t0m)
- - Tests for this (t0m)
+ B::Hooks::OP::Check::StashChange if installed
+ - Tests for this
- Naive implementation of making all components mutable in the
forked restart watcher process so native Moose apps using
- immutable restart correctly. (t0m)
- - Tests for this (t0m)
+ immutable restart correctly.
+ - Tests for this
- Bump Moose dependency to 0.70 so that we avoid nasty surprises
- with is_class_loaded and perl 5.80 when you Moosify MyApp.pm (t0m)
+ with is_class_loaded and perl 5.80 when you Moosify MyApp.pm
- Clarify that request arguments aren't unescaped automatically
(Simon Bertrang) (Closes RT#41153)
- - Don't require C3 for the MRO test (rafl)
- - Bump MX::Emulate::CAF prereq to support list assignment (rafl)
- - Remove useless column in chained action debug table. (rafl)
- - namespace::clean related cleanups (rafl)
- - Import related cleanups and consistency fixes (rafl)
- - Fix test suite TestApp /dump/env action (t0m)
- - Add $res->code as alias for $res->status (hdp)
+ - Don't require C3 for the MRO test
+ - Bump MX::Emulate::CAF prereq to support list assignment
+ - Remove useless column in chained action debug table.
+ - namespace::clean related cleanups
+ - Import related cleanups and consistency fixes
+ - Fix test suite TestApp /dump/env action
+ - Add $res->code as alias for $res->status
- Make Catalyst::ClassData compatible with the latest Class::MOP::Class
- changes. Also depend on the latest Class::MOP. (rafl)
- - Add $c->uri_for_action method. (hdp)
- - Don't stringify the meta method. Use its name instead. (rafl)
+ changes. Also depend on the latest Class::MOP.
+ - Add $c->uri_for_action method.
+ - Don't stringify the meta method. Use its name instead.
- Use MooseX::MethodAttributes::Inheritable to contain action
attributes. This means that attributes are now represented in the MOP,
- allowing method modifiers on actions to work as expected. (rafl)
+ allowing method modifiers on actions to work as expected.
- Provide a reasonable API in Catalyst::Controller for working with
and registering actions, allowing a controller sub-class to replace
subroutine attributes for action declerations with an alternate
- syntax. (rafl/hdp)
+ syntax.
- Instantiate correct sub-class of Moose::Meta::Class for non-Moose
components where Catalyst forces the creation of a metaclass instance.
This is more correct, and avoids metaclass incompatibility in complex
- cases (t0m)
- - Tests for this (t0m)
- - Use of deprecated Catalyst::Base now warns. (t0m)
- - Add uri_with tests (gphat)
+ cases
+ - Tests for this
+ - Use of deprecated Catalyst::Base now warns.
+ - Add uri_with tests
5.8000_06 2009-02-04 21:00
- - Disallow writing to config after setup (rafl)
- - Disallow calling setup more than once (rafl)
+ - Disallow writing to config after setup
+ - Disallow calling setup more than once
- Documentation fix regarding overloading of Engine and Dispatcher
- instances (rafl)
- - Several documentation typo fixes (rafl)
+ instances
+ - Several documentation typo fixes
- Stop Makefile.PL from warning about versions that fixed a conflict
- (t0m)
- - Improved upgrading documentation (t0m, rafl)
+ - Improved upgrading documentation
- Seed the RNG in each FastCGI child process (Andrew Rodland)
- - Properly report dynamic bind port for the development server (rafl)
+ - Properly report dynamic bind port for the development server
(Closes RT#38544)
- Use the way documented by IO::Socket::INET to get the error message
- after trying to create a listening socket (rafl) (Closes RT#41828)
+ after trying to create a listening socket (Closes RT#41828)
- Don't ignore SIGCHLD while handling requests with the dev server
- (rafl) (Closes RT#42962)
+ (Closes RT#42962)
5.8000_05 2008-29-01 00:00
- Text::SimpleTable's go as wide as $ENV{COLUMNS} (jhannah)
@@ -231,131 +371,129 @@
- Improve the clarity and verbosity of the warning when component
resolution uses regex fallback. (jhannah)
- Handle leading CRLF in HTTP requests sometimes sent by IE6 in
- keep-alive requests. (andyg)
+ keep-alive requests.
- Fixes for FastCGI with IIS 6.0 (janus)
- Passing request method exported by Catalyst::Test an extra
parameter used to be ignored, but started breaking if the parameter
was not a hash in 5.8000_04. Extra parameter is now ignored if
- it isn't a hashref (t0m)
+ it isn't a hashref
- Fix request argumentss getting corrupted if you override the
dispatcher and call an action which detaches (for
- Catalyst::Plugin::Authorization::ACL) (t0m)
+ Catalyst::Plugin::Authorization::ACL)
- Fix calling use Catalyst::Test 'MyApp' 'foo' which used to work,
- but stopped as the 2nd parameter can be an options hash now (t0m)
- - Bump Moose dependency to fix make_immutable bug (t0m)
- - Use compile time extends in Catalyst::Controller (t0m)
+ but stopped as the 2nd parameter can be an options hash now
+ - Bump Moose dependency to fix make_immutable bug
+ - Use compile time extends in Catalyst::Controller
- Make Catalyst::Request::uploads attribute non-lazy, to fix
- test for Catalyst-Engine-Apache (t0m)
- - Bump version of MooseX::Emulate::Class::Accessor::Fast (t0m)
+ test for Catalyst-Engine-Apache
+ - Bump version of MooseX::Emulate::Class::Accessor::Fast
- Stop using MooseX::Adopt::Class::Accessor::Fast by default, to stop
breaking other packages which use Class::Accessor::Fast
- Remove unused action_container_class attribute from
- Catalyst::Dispatcher (t0m)
- - Replace {_body} instance access with calls to _body accessors (t0m)
+ Catalyst::Dispatcher
+ - Replace {_body} instance access with calls to _body accessors
- Add backwards compatibility alias methods for private attributes on
Catalyst::Dispatcher which used to be public. Needed by
Catalyst::Plugin::Server and Catalyst::Plugin::Authorization::ACL
- (t0m)
- Fix return value of $c->req->body, which delegates to the body
- method on the requests HTTP::Body instance (t0m)
- - Test for this (t0m)
+ method on the requests HTTP::Body instance
+ - Test for this
- Fix calling $c->req->body from inside an overridden prepare_action
- method in a plugin, as used by Catalyst::Plugin::Server (t0m)
- - Test for this (t0m)
+ method in a plugin, as used by Catalyst::Plugin::Server
+ - Test for this
- Fix assignment to Catalyst::Dispatcher's preload_dispatch_types and
postload_dispatch_types attributes - assigning a list should later
- return a listref. Fixes Catalyst::Plugin::Server. (t0m)
- - Tests for this (t0m)
+ return a listref. Fixes Catalyst::Plugin::Server.
+ - Tests for this
- Change streaming test to serve itself rather than 01use.t, making
- test sync for engines easier (t0m)
+ test sync for engines easier
- Refactor capturing of $app from Catalyst::Controller into
Catalyst::Component::ApplicationAttribute for easier reuse in other
- components (Florian Ragwitz)
- - Make the test suites YAML dependency optional (Florian Ragwitz)
+ components
+ - Make the test suites YAML dependency optional
- Make debug output show class name for the engine and dispatcher
- rather than the stringified ref. (t0m)
+ rather than the stringified ref.
- Make MyApp immutable at the end of the scope after the setup
method is called, fixing issues with plugins which have their
- own new methods by inlining a constructor on MyApp (t0m)
- - Test for this and method modifiers in MyApp (t0m)
+ own new methods by inlining a constructor on MyApp
+ - Test for this and method modifiers in MyApp
- Fix bug causing Catalyst::Request::Upload's basename method
- to return undef (t0m)
+ to return undef
- Test for this (Carl Franks)
- Fix loading of classes which do not define any symbols to not
- die, as it didn't in 5.70 (t0m)
- - Test for this (t0m)
+ die, as it didn't in 5.70
+ - Test for this
- Bump MooseX::Emulate::Class::Accessor::Fast dependency
- to force new version which fixes a lot of plugins (t0m)
+ to force new version which fixes a lot of plugins
- Make log levels additive, and add documentation and tests
for the setup_log method, which previously had none.
- Sewn together by t0m from two patches provided by David E. Wheeler
+ Sewn together by from two patches provided by David E. Wheeler
- Switch an around 'new' in Catalyst::Controller to a BUILDARGS
- method as it's much neater and more obvious what is going on (t0m)
+ method as it's much neater and more obvious what is going on
- Add a clearer method on request and response _context
attributes, and use if from ::Engine rather than deleting
- the key from the instance hash (t0m)
+ the key from the instance hash
- Use handles on tree attribute of Catalyst::Stats to replace
- trivial delegation methods (t0m)
+ trivial delegation methods
- Change the following direct hash accesses into attributes:
Catalyst::Engine: _prepared_write
Catalyst::Engine::CGI: _header_buf
Catalyst::Engine::HTTP: options, _keepalive, _write_error
Catalyst::Request: _path
Catalyst::Stats: tree
- (t0m)
- Fix issues in Catalyst::Controller::WrapCGI
and any other components which import (or define) their
own meta method by always explicitly calling
- Class::MOP::Object->meta inside Catalyst (t0m)
- - Add test for this (t0m)
+ Class::MOP::Object->meta inside Catalyst
+ - Add test for this
- Add test case for the bug which is causing the
- Catalyst::Plugin::Authentication tests to fail (t0m)
+ Catalyst::Plugin::Authentication tests to fail
- Fix a bug in uri_for which could cause it to generate paths
- with multiple slashes in them. (t0m)
- - Add test for this (t0m)
+ with multiple slashes in them.
+ - Add test for this
- Fix SKIP block name in t/optional_http-server-restart.t,
stopping 'Label not found for "last SKIP"' error from
- Test::More (t0m)
- - Workaround max_redirect 0 bug in LWP (andyg)
- - Move live_engine_response_print into aggregate (andyg)
- - Fix dependency bug, s/parent/base/ in new test (rafl)
+ Test::More
+ - Workaround max_redirect 0 bug in LWP
+ - Move live_engine_response_print into aggregate
+ - Fix dependency bug, s/parent/base/ in new test
- Fix optional tests to run the live tests in the aggregate
- dir (andyg)
- - Fix Catalyst->go error in remote tests (andyg)
+ dir
+ - Fix Catalyst->go error in remote tests
- Fix upload test to work with remote servers, don't check for
- deleted files (andyg)
+ deleted files
- Fix engine_request_uri tests to work on remote server with
- different URI (andyg)
+ different URI
5.8000_04 2008-12-05 12:15:00
- - Silence Class::C3::Adopt::NEXT warnings in the test suite (rafl)
- - Fix loads of 'used once, possible typo' warnings (rafl)
- - Additional tests to ensure upload temp files are deleted (andyg)
+ - Silence Class::C3::Adopt::NEXT warnings in the test suite
+ - Fix loads of 'used once, possible typo' warnings
+ - Additional tests to ensure upload temp files are deleted
- Remove use of NEXT from the test suite, except for one case
- which tests if Class::C3::Adopt::NEXT is working (t0m)
+ which tests if Class::C3::Adopt::NEXT is working
- Use a predicate to avoid recursion in cases where the uri
method is overridden by a plugin, and calls the base method,
- for example Catalyst::Plugin::SmartURI (t0m)
+ for example Catalyst::Plugin::SmartURI
- Test for this (caelum)
- Compose the MooseX::Emulate::Class::Accessor::Fast role to
Catalyst::Action, Catalyst::Request, and all other modules which
inherit from Class::Accessor::Fast in 5.70.
This fixes:
- Catalyst::Controller::HTML::FormFu (zamolxes)
- - Catalyst::Request::REST (t0m)
- - Test for this (t0m)
+ - Catalyst::Request::REST
+ - Test for this
- Make hostname resolution lazy (Marc Mims)
- Support mocking virtualhosts in test suite (Jason Gottshall)
- - Add README (marcus)
- - Fix TODO list (t0m)
- - Use Class::C3::Adopt::NEXT (rafl)
- - Ignore C3 warnings on 5.10 when testing ensure_class_loaded (rafl)
+ - Add README
+ - Fix TODO list
+ - Use Class::C3::Adopt::NEXT
+ - Ignore C3 warnings on 5.10 when testing ensure_class_loaded
- Add TODO test for chained bug (gbjk)
- Fix list address in documentation (zarquon)
- - Fix ACCEPT_CONTEXT on MyApp, called as a class method (marcus)
- - Test for this (marcus)
+ - Fix ACCEPT_CONTEXT on MyApp, called as a class method
+ - Test for this
- Bump MooseX::Emulate::Class::Accessor::Fast version requirement to
- get more back compatibility (t0m)
+ get more back compatibility
- Improve documentation for $req->captures (caelum)
- Fix a bug in Catalyst::Stats, stopping garbage being inserted into
the stats if a user calls begin => but no end => (jhannah)
@@ -363,16 +501,16 @@
- Trim lines sooner in stats to avoid ugly Text::SimpleTable wrapping
(jhannah)
- Change Catalyst::ClassData to tweak the symbol table inline for
- performance after profiling (mst)
+ performance after profiling
- Fix POD typo in finalize_error (jhannah)
- Add tests to ensure that we delete the temp files created by
- HTTP::Body's OctetStream parser (t0m)
+ HTTP::Body's OctetStream parser
5.8000_03 2008-10-14 14:13:00
- - Fix forwarding to Catalyst::Action objects (Rafael Kitover).
+ - Fix forwarding to Catalyst::Action objects.
- Fix links to the mailing lists (RT #39754 and Florian Ragwitz).
- - Use Class::MOP instead of Class::Inspector (Florian Ragwitz).
- - Change Catalyst::Test to use Sub::Exporter (Florian Ragwitz).
+ - Use Class::MOP instead of Class::Inspector.
+ - Change Catalyst::Test to use Sub::Exporter.
- Fixed typo in Engine::HTTP::Restarter::Watcher causing -r to complain.
5.8000_02 2008-10-14 07:59:00
@@ -382,11 +520,11 @@
- Port to Moose
- Added test for action stringify
- Added test for component instances getting $self->{value} from config.
- - Add Catalyst::Response->print() method (ilmari)
- - Optionally aggregate tests using Test::Aggregate (Florian Ragwitz).
+ - Add Catalyst::Response->print() method
+ - Optionally aggregate tests using Test::Aggregate.
- Additional docs for uri_for to mention how to use $c->action and
$c->req->captures (jhannah)
- - List unattached chained actions in Debug mode (Florian Ragwitz).
+ - List unattached chained actions in Debug mode.
- Pod formatting fix for Engine::FastCGI (Oleg Kostyuk).
- Add visit, a returning ->go
@@ -395,7 +533,7 @@
- Back out go() since that feature's been pushed to 5.80
- Fix some Win32 test failures
- Add pt translation of error message (wreis)
- - Make :Chained('../action') work (Florian Ragwitz)
+ - Make :Chained('../action') work
- Add test actions
- Chained doc improvements (rev 8326-8328)
@@ -409,7 +547,7 @@
- Added PathPrefix attribute
- Removed Catalyst::Build; we've long since moved to Module::Install
- Updated Catalyst::Test docs to mention the use of HTTP::Request
- objects (Rafael Kitover)
+ objects
5.7099_01 2008-06-25 22:36:00
- Refactored component resolution (component(), models(), model(), et al). We now
@@ -448,8 +586,8 @@
- Fix grammar on welcome page (RT #33236)
- Fix for Path('0') handling (RT #29334)
- Workaround for Win32 and c3_mro.t (RT #26452, tested by Kenichi Ishigaki)
- - Fix for encoding query parameters (edenc)
- - Fix Chained multiple test (t0m)
+ - Fix for encoding query parameters
+ - Fix Chained multiple test
5.7012 2007-12-16 23:44:00
- Fix uri_for()'s and uri_with()'s handling of multibyte chars
@@ -888,7 +1026,7 @@
- Now with updated manifest.
5.32 2005-08-10 15:10:00
- - Dispatcher might fail if object returns false. (Florian Ragwitz)
+ - Dispatcher might fail if object returns false.
5.31 2005-06-04 12:35:00 (never released to CPAN)
Modified: Catalyst-Runtime/5.80/branches/better_scripts/MANIFEST.SKIP
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/MANIFEST.SKIP 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/MANIFEST.SKIP 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1 +1 @@
-^(?!script/\w+\.pl$|TODO$|lib/.+(?<!ROADMAP)\.p(m|od)$|inc/|t/aggregate/.*\.t$|t/.*\.(gif|yml|pl|t)$|t/lib/.*\.pm$|t/something/(Makefile.PL|script/foo/bar/for_dist)$|t/conf/extra.conf.in$|Makefile.PL$|README$|MANIFEST$|Changes$|META.yml$)
+^(?!script/\w+\.pl$|TODO$|lib/.+(?<!ROADMAP)\.p(m|od)$|inc/|t/a(uthor|ggregate)/.*\.t$|t/.*\.(gif|yml|pl|t)$|t/lib/.*\.pm$|t/something/(Makefile.PL|script/foo/bar/for_dist)$|t/conf/extra.conf.in$|Makefile.PL$|README$|MANIFEST$|Changes$|META.yml$)
Modified: Catalyst-Runtime/5.80/branches/better_scripts/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/Makefile.PL 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/Makefile.PL 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,22 +1,31 @@
+use strict;
+use warnings;
use inc::Module::Install 0.87;
+BEGIN { # Make it easy for newbies
+ if ($Module::Install::AUTHOR) {
+ require Module::Install::AuthorRequires;
+ require Module::Install::CheckConflicts;
+ require Module::Install::AuthorTests;
+ }
+}
+perl_version '5.008004';
-perl_version '5.008001';
-
name 'Catalyst-Runtime';
all_from 'lib/Catalyst/Runtime.pm';
+requires 'List::MoreUtils';
+requires 'namespace::autoclean';
requires 'namespace::clean';
requires 'namespace::autoclean';
requires 'B::Hooks::EndOfScope' => '0.08';
requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00801';
requires 'Class::MOP' => '0.83';
requires 'Moose' => '0.78';
-requires 'MooseX::MethodAttributes::Inheritable' => '0.12';
+requires 'MooseX::MethodAttributes::Inheritable' => '0.15';
requires 'Carp';
requires 'Class::C3::Adopt::NEXT' => '0.07';
requires 'CGI::Simple::Cookie';
requires 'Data::Dump';
-requires 'File::Modified';
requires 'HTML::Entities';
requires 'HTTP::Body' => '1.04'; # makes uploadtmp work
requires 'HTTP::Headers' => '1.64';
@@ -24,7 +33,7 @@
requires 'HTTP::Response';
requires 'HTTP::Request::AsCGI' => '0.8';
requires 'LWP::UserAgent';
-requires 'Module::Pluggable' => '3.01';
+requires 'Module::Pluggable' => '3.9';
requires 'Path::Class' => '0.09';
requires 'Scalar::Util';
requires 'Sub::Exporter';
@@ -33,17 +42,20 @@
requires 'Tree::Simple' => '1.15';
requires 'Tree::Simple::Visitor::FindByPath';
requires 'URI' => '1.35';
+requires 'Task::Weaken';
requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
requires 'MRO::Compat';
requires 'MooseX::Getopt';
requires 'MooseX::Types';
+requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
test_requires 'Class::Data::Inheritable';
test_requires 'Test::Exception';
-# aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate is available
-if ($ENV{AGGREGATE_TESTS} && can_use('Test::Aggregate', '0.34_01')) {
- test_requires('Test::Aggregate', '0.34_01');
+# aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available
+if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) {
+ author_requires('Test::Aggregate', '0.35_05');
+ author_requires('Test::Simple', '0.88');
}
else {
tests join q{ },
@@ -51,41 +63,30 @@
map { glob } qw[t/*.t t/aggregate/*.t];
}
-my @force_build_requires_if_author = qw(
+author_tests 't/author';
+author_requires(map {; $_ => 0 } qw(
Test::NoTabs
Test::Pod
Test::Pod::Coverage
Pod::Coverage
-);
+));
if ($Module::Install::AUTHOR) {
- foreach my $module (@force_build_requires_if_author) {
- build_requires $module;
- }
darwin_check_no_resource_forks();
}
+resources(
+ 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst',
+ 'IRC' => 'irc://irc.perl.org/#catalyst',
+ 'license', => 'http://dev.perl.org/licenses/',
+ 'homepage', => 'http://dev.catalyst.perl.org/',
+ 'repository', => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/',
+);
+
install_script glob('script/*.pl');
auto_install;
WriteAll;
-if ($Module::Install::AUTHOR) {
-
- # Strip out the author only build_requires from META.yml
- # Need to do this _after_ WriteAll else it looses track of them
- strip_author_only_build_requires(@force_build_requires_if_author, 'Test::Aggregate');
-
- Meta->{values}{resources} = [
- [ 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst' ],
- [ 'IRC' => 'irc://irc.perl.org/#catalyst' ],
- [ 'license', => 'http://dev.perl.org/licenses/' ],
- [ 'homepage', => 'http://dev.catalyst.perl.org/'],
- [ 'repository', => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/' ],
- ];
-
- Meta->write;
-}
-
print <<"EOF";
Important:
@@ -98,7 +99,7 @@
perl -MCPANPLUS -e 'install Catalyst::Devel' # or
perl -MCPAN -e 'install Catalyst::Devel'
- To get some commonly used plugins, as well as the TT view and DBIC
+ To get some commonly used plugins, as well as the TT view and DBIC
model, install Task::Catalyst in the same way.
Have fun!
@@ -121,7 +122,7 @@
'Catalyst::Plugin::Upload::Image::Magick' => '0.03',
'Catalyst::Plugin::ConfigLoader' => '0.22', # Older versions work but
# throw Data::Visitor warns
- 'Catalyst::Devel' => '0.09',
+ 'Catalyst::Devel' => '1.19',
'Catalyst::Plugin::SmartURI' => '0.032',
'CatalystX::CRUD' => '0.37',
'Catalyst::Action::RenderView' => '0.07',
@@ -132,6 +133,7 @@
'Catalyst::Action::REST' => '0.67',
'CatalystX::CRUD' => '0.42',
'CatalystX::CRUD::Model::RDBO' => '0.20',
+ 'Catalyst::View::Mason' => '0.17',
);
check_conflicts(%conflicts);
@@ -144,64 +146,11 @@
# TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
# On 10.5 (Leopard) it wants COPYFILE_DISABLE
- my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
+ die("Oh, you got Snow Lepoard, snazzy. Please read the man page for tar to find out if Apple renamed COPYFILE_DISABLE again and fix this Makefile.PL please?\n") if $osx_ver =~ /^10.6/;
+ my $attr = $osx_ver =~ /^10.5/ ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
qq{ echo "You must set the ENV variable $attr to true,"; }.
' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
- }
-}
-
-sub strip_author_only_build_requires {
- my @build_requires_to_strip = @_;
- Meta->{values}{build_requires} = [ grep {
- my $ok = 1;
- foreach my $module (@build_requires_to_strip) {
- if ($_->[0] =~ /$module/) {
- $ok = 0;
- last;
- }
- }
- $ok;
- } @{Meta->{values}{build_requires}} ];
-}
-
-sub check_conflicts {
- my %conflicts = @_;
-
- my %conflicts_found;
- for my $mod ( sort keys %conflicts ) {
- eval "require($mod)";
- next if $@;
-
- my $installed = $mod->VERSION();
- $conflicts_found{$mod} = $installed if ( $installed le $conflicts{$mod} );
}
-
- return unless scalar keys %conflicts_found;
-
- print <<"EOF";
-
- WARNING:
-
- This version of Catalyst conflicts with the versions of
- some components you have installed.
-
- You will need to upgrade these modules after installing
- this version of Catalyst.
-
- List of the conflicting components and their installed versions:
-
-EOF
-
- foreach my $mod (keys %conflicts_found) {
- print sprintf(" %s => %s\n", $mod, $conflicts_found{$mod});
- }
- print "\n";
-
- # More or less copied from Module::Build, via Moose
- return if $ENV{PERL_MM_USE_DEFAULT};
- return unless -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
-
- sleep 4;
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/TODO
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/TODO 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/TODO 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,25 +1,62 @@
-Known Bugs:
+# Known Bugs:
- Bug ->go or ->visit causes actions which have Args or CaptureArgs called
twice when called via ->go or ->visit.
Test app: http://github.com/bobtfish/catalyst-app-bug-go_chain/tree/master
-Compatibility warnings to add:
+ - Bricas' Exception blog post
- - $self->config should warn as config should only ever be called as a
- class method.
+ http://bricas.vox.com/library/post/catalyst-exceptionclass.html
-Proposed functionality / feature additions:
+ Broken by recent exception refactoring
- - Log setup needs to be less lame, so Catalyst::Plugin::Log::* can die
- in a fire. Having $c->log_class would be a good start. kane volunteered
- to do some of this.
+# Compatibility warnings to add:
- Simple example: Catalyst::Plugin::Log::Colorful should just be a
- subclass of Catalyst::Log, no ::Plugin:: needed.
+ - $self->config should warn as config should only ever be called as a
+ class method (TESTS).
- See also: Catalyst::Plugin::Log::Dispatch and
- http://github.com/willert/catalyst-plugin-log4perl-simple/tree
+# Proposed functionality / feature additions:
+## Log setup needs to be less lame
+So Catalyst::Plugin::Log::* can die
+in a fire. Having $c->log_class would be a good start. kane volunteered
+to do some of this.
+
+Simple example: Catalyst::Plugin::Log::Colorful should just be a
+subclass of Catalyst::Log, no ::Plugin:: needed.
+
+See also: Catalyst::Plugin::Log::Dispatch and
+http://github.com/willert/catalyst-plugin-log4perl-simple/tree
+
+# REFACTORING
+
+## The horrible hack for plugin setup - replacing it:
+
+ * Have a look at the Devel::REPL BEFORE_PLUGIN stuff
+ I wonder if what we need is that combined with plugins-as-roles
+
+## App / ctx split:
+
+ NOTE - these are notes that t0m thought up after doing back compat for
+ catalyst_component_class, may be inaccurate, wrong or missing things
+ bug mst (at least) to correct before trying more than the first 2
+ steps. Please knock yourself out on the first two however :)
+
+ - Eliminate actions in MyApp from the main test suite
+ - Uncomment warning in C::C::register_action_methods, add tests it works
+ by mocking out the logging..
+ - Remove MyApp @ISA controller (ask metaclass if it has attributes, and if
+ so you need back compat :/)
+ - Make Catalyst::Context, move the per request stuff in there, handles from
+ main app class to delegate
+ - Make an instance of the app class which is a global variable
+ - Make new instance of the context class, not the app class per-request
+ - Remove the components as class data, move to instance data on the app
+ class (you probably have to do this for _all_ the class data, good luck!)
+ - Make it possible for users to spin up different instances of the app class
+ (with different config etc each)
+ - Profit! (Things like changing the complete app config per vhost, i.e.
+ writing a config loader / app class role which dispatches per vhost to
+ differently configured apps is piss easy)
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Action.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Action.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Action.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -8,6 +8,8 @@
<form action="[%c.uri_for(c.action)%]">
+ $c->forward( $action->private_path );
+
=head1 DESCRIPTION
This class represents a Catalyst Action. You can access the object for the
@@ -18,8 +20,9 @@
=cut
use Moose;
-
+use Scalar::Util 'looks_like_number';
with 'MooseX::Emulate::Class::Accessor::Fast';
+use namespace::clean -except => 'meta';
has class => (is => 'rw');
has namespace => (is => 'rw');
@@ -27,9 +30,14 @@
has attributes => (is => 'rw');
has name => (is => 'rw');
has code => (is => 'rw');
+has private_path => (
+ reader => 'private_path',
+ isa => 'Str',
+ lazy => 1,
+ required => 1,
+ default => sub { '/'.shift->reverse },
+);
-no Moose;
-
use overload (
# Stringify to reverse for debug output etc.
@@ -47,8 +55,6 @@
no warnings 'recursion';
-#__PACKAGE__->mk_accessors(qw/class namespace reverse attributes name code/);
-
sub dispatch { # Execute ourselves against a context
my ( $self, $c ) = @_;
return $c->execute( $self->class, $self );
@@ -70,6 +76,18 @@
return scalar( @{ $c->req->args } ) == $args;
}
+sub compare {
+ my ($a1, $a2) = @_;
+
+ my ($a1_args) = @{ $a1->attributes->{Args} || [] };
+ my ($a2_args) = @{ $a2->attributes->{Args} || [] };
+
+ $_ = looks_like_number($_) ? $_ : ~0
+ for $a1_args, $a2_args;
+
+ return $a1_args <=> $a2_args;
+}
+
__PACKAGE__->meta->make_immutable;
1;
@@ -85,7 +103,9 @@
=head2 class
-Returns the class name where this action is defined.
+Returns the name of the component where this action is defined.
+Derived by calling the L<Catalyst::Component/catalyst_component_name|catalyst_component_name>
+method on each component.
=head2 code
@@ -93,7 +113,7 @@
=head2 dispatch( $c )
-Dispatch this action against a context
+Dispatch this action against a context.
=head2 execute( $controller, $c, @args )
@@ -105,6 +125,11 @@
Check Args attribute, and makes sure number of args matches the setting.
Always returns true if Args is omitted.
+=head2 compare
+
+Compares 2 actions based on the value of the C<Args> attribute, with no C<Args>
+having the highest precedence.
+
=head2 namespace
Returns the private namespace this action lives in.
@@ -113,13 +138,18 @@
Returns the private path for this action.
+=head2 private_path
+
+Returns absolute private path for this action. Unlike C<reverse>, the
+C<private_path> of an action is always suitable for passing to C<forward>.
+
=head2 name
-returns the sub name of this action.
+Returns the sub name of this action.
=head2 meta
-Provided by Moose
+Provided by Moose.
=head1 AUTHORS
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/ClassData.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/ClassData.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/ClassData.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -6,7 +6,7 @@
use Moose::Util ();
sub mk_classdata {
- my ($class, $attribute) = @_;
+ my ($class, $attribute, $warn_on_instance) = @_;
confess("mk_classdata() is a class method, not an object method")
if blessed $class;
Added: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component/ContextClosure.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component/ContextClosure.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component/ContextClosure.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,75 @@
+package Catalyst::Component::ContextClosure;
+
+use Moose::Role;
+use Scalar::Util 'weaken';
+use namespace::autoclean;
+
+sub make_context_closure {
+ my ($self, $closure, $ctx) = @_;
+ weaken $ctx;
+ return sub { $closure->($ctx, @_) };
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Component::ContextClosure - Moose Role for components which need to close over the $ctx, without leaking
+
+=head1 SYNOPSIS
+
+ package MyApp::Controller::Foo;
+ use Moose;
+ use namespace::autoclean;
+ BEGIN {
+ extends 'Catalyst::Controller';
+ with 'Catalyst::Component::ContextClosure';
+ }
+
+ sub some_action : Local {
+ my ($self, $ctx) = @_;
+ $ctx->stash(a_closure => $self->make_context_closure(sub {
+ my ($ctx) = @_;
+ $ctx->response->body('body set from closure');
+ }, $ctx);
+ }
+
+=head1 DESCRIPTION
+
+A common problem with stashing a closure, that closes over the Catalyst context
+(often called C<$ctx> or C<$c>), is the circular reference it creates, as the
+closure holds onto a reference to context, and the context holds a reference to
+the closure in its stash. This creates a memory leak, unless you always
+carefully weaken the closures context reference.
+
+This role provides a convenience method to create closures, that closes over
+C<$ctx>.
+
+=head1 METHODS
+
+=head2 make_context_closure ($closure, $ctx)
+
+Returns a code reference, that will invoke C<$closure> with a weakened
+reference to C<$ctx>. All other parameters to the returned code reference will
+be passed along to C<$closure>.
+
+=head1 SEE ALSO
+
+L<Catalyst::Component>
+
+L<Catalyst::Controller>
+
+L<CatalystX::LeakChecker>
+
+=head1 AUTHOR
+
+Florian Ragwitz E<lt>rafl at debian.orgE<gt>
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Component.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -60,6 +60,18 @@
__PACKAGE__->mk_classdata('_plugins');
__PACKAGE__->mk_classdata('_config');
+has catalyst_component_name => ( is => 'ro' ); # Cannot be required => 1 as context
+ # class @ISA component - HATE
+# Make accessor callable as a class method, as we need to call setup_actions
+# on the application class, which we don't have an instance of, ewwwww
+# Also, naughty modules like Catalyst::View::JSON try to write to _everything_,
+# so spit a warning, ignore that (and try to do the right thing anyway) here..
+around catalyst_component_name => sub {
+ my ($orig, $self) = (shift, shift);
+ Carp::cluck("Tried to write to the catalyst_component_name accessor - is your component broken or just mad? (Write ignored - using default value.)") if scalar @_;
+ blessed($self) ? $self->$orig() || blessed($self) : $self;
+};
+
sub BUILDARGS {
my $class = shift;
my $args = {};
@@ -85,23 +97,24 @@
}
sub COMPONENT {
- my ( $self, $c ) = @_;
+ my ( $class, $c ) = @_;
# Temporary fix, some components does not pass context to constructor
my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {};
- if( my $next = $self->next::can ){
- my $class = blessed $self || $self;
+ if ( my $next = $class->next::can ) {
my ($next_package) = Class::MOP::get_code_info($next);
warn "There is a COMPONENT method resolving after Catalyst::Component in ${next_package}.\n";
warn "This behavior can no longer be supported, and so your application is probably broken.\n";
warn "Your linearized isa hierarchy is: " . join(', ', @{ mro::get_linear_isa($class) }) . "\n";
warn "Please see perldoc Catalyst::Upgrading for more information about this issue.\n";
}
- return $self->new($c, $arguments);
+ return $class->new($c, $arguments);
}
sub config {
my $self = shift;
+ # Uncomment once sane to do so
+ #Carp::cluck("config method called on instance") if ref $self;
my $config = $self->_config || {};
if (@_) {
my $newconfig = { %{@_ > 1 ? {@_} : $_[0]} };
@@ -157,9 +170,10 @@
it is called by Catalyst during setup_components with the application class
as $c and any config entry on the application for this component (for example,
in the case of MyApp::Controller::Foo this would be
-MyApp->config->{'Controller::Foo'}). The arguments are expected to be a
-hashref and are merged with the __PACKAGE__->config hashref before calling
-->new to instantiate the component.
+C<< MyApp->config('Controller::Foo' => \%conf >>).
+The arguments are expected to be a hashref and are merged with the
+C<< __PACKAGE__->config >> hashref before calling C<< ->new >>
+to instantiate the component.
You can override it in your components to do custom instantiation, using
something like this:
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Controller.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Controller.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -44,6 +44,8 @@
$self->_controller_actions($attr_value);
}
+
+
=head1 NAME
Catalyst::Controller - Catalyst Controller base class
@@ -135,28 +137,30 @@
my $orig = shift;
my ( $self, $c ) = @_;
+ my $class = ref($self) || $self;
+ my $appclass = ref($c) || $c;
if( ref($self) ){
return $self->$orig if $self->has_action_namespace;
} else {
- return $self->config->{namespace} if exists $self->config->{namespace};
+ return $class->config->{namespace} if exists $class->config->{namespace};
}
my $case_s;
if( $c ){
- $case_s = $c->config->{case_sensitive};
+ $case_s = $appclass->config->{case_sensitive};
} else {
if ($self->isa('Catalyst')) {
- $case_s = $self->config->{case_sensitive};
+ $case_s = $class->config->{case_sensitive};
} else {
if (ref $self) {
- $case_s = $self->_application->config->{case_sensitive};
+ $case_s = ref($self->_application)->config->{case_sensitive};
} else {
confess("Can't figure out case_sensitive setting");
}
}
}
- my $namespace = Catalyst::Utils::class2prefix(ref($self) || $self, $case_s) || '';
+ my $namespace = Catalyst::Utils::class2prefix($self->catalyst_component_name, $case_s) || '';
$self->$orig($namespace) if ref($self);
return $namespace;
};
@@ -177,14 +181,29 @@
sub get_action_methods {
my $self = shift;
- my $meta = find_meta($self);
- confess("Metaclass for " . ref($meta) ." for " . $meta->name
- . " cannot support register_actions.")
- unless $meta->can('get_nearest_methods_with_attributes');
+ my $meta = find_meta($self) || confess("No metaclass setup for $self");
+ confess("Metaclass "
+ . ref($meta) . " for "
+ . $meta->name
+ . " cannot support register_actions." )
+ unless $meta->can('get_nearest_methods_with_attributes');
my @methods = $meta->get_nearest_methods_with_attributes;
+
+ # actions specified via config are also action_methods
+ push(
+ @methods,
+ map {
+ $meta->find_method_by_name($_)
+ || confess( 'Action "'
+ . $_
+ . '" is not available from controller '
+ . ( ref $self ) )
+ } keys %{ $self->_controller_actions }
+ ) if ( ref $self );
return @methods;
}
+
sub register_actions {
my ( $self, $c ) = @_;
$self->register_action_methods( $c, $self->get_action_methods );
@@ -192,14 +211,18 @@
sub register_action_methods {
my ( $self, $c, @methods ) = @_;
- my $class = ref $self || $self;
+ my $class = $self->catalyst_component_name;
#this is still not correct for some reason.
my $namespace = $self->action_namespace($c);
+ # Uncomment as soon as you fix the tests :)
+ #if (!blessed($self) && $self eq $c && scalar(@methods)) {
+ # $c->log->warn("Action methods found defined in your application class, $self. This is deprecated, please move them into a Root controller.");
+ #}
+
foreach my $method (@methods) {
my $name = $method->name;
my $attributes = $method->attributes;
- next unless $attributes;
my $attrs = $self->_parse_attrs( $c, $name, @{ $attributes } );
if ( $attrs->{Private} && ( keys %$attrs > 1 ) ) {
$c->log->debug( 'Bad action definition "'
@@ -370,15 +393,14 @@
}
sub _parse_PathPrefix_attr {
- my $self = shift;
- return PathPart => $self->path_prefix;
+ my ( $self, $c ) = @_;
+ return PathPart => $self->path_prefix($c);
}
sub _parse_ActionClass_attr {
my ( $self, $c, $name, $value ) = @_;
- unless ( $value =~ s/^\+// ) {
- $value = join('::', $self->_action_class, $value );
- }
+ my $appname = $self->_application;
+ $value = Catalyst::Utils::resolve_namespace($appname . '::Action', $self->_action_class, $value);
return ( 'ActionClass', $value );
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Chained.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Chained.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -80,14 +80,16 @@
return unless $self->_endpoints;
- my $column_width = Catalyst::Utils::term_width() - 35 - 9;
+ my $avail_width = Catalyst::Utils::term_width() - 9;
+ my $col1_width = ($avail_width * .50) < 35 ? 35 : int($avail_width * .50);
+ my $col2_width = $avail_width - $col1_width;
my $paths = Text::SimpleTable->new(
- [ 35, 'Path Spec' ], [ $column_width, 'Private' ],
+ [ $col1_width, 'Path Spec' ], [ $col2_width, 'Private' ],
);
my $has_unattached_actions;
my $unattached_actions = Text::SimpleTable->new(
- [ 35, 'Private' ], [ $column_width, 'Missing parent' ],
+ [ $col1_width, 'Private' ], [ $col2_width, 'Missing parent' ],
);
ENDPOINT: foreach my $endpoint (
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Default.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Default.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Default.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -41,7 +41,7 @@
sub match {
my ( $self, $c, $path ) = @_;
- return if $path =~ m!/!; # Not at root yet, wait for it ...
+ return if $path ne ''; # Not at root yet, wait for it ...
my $result = ( $c->get_actions( 'default', $c->req->path ) )[-1];
# Find default on namespace or super
@@ -58,6 +58,8 @@
return 0;
}
+sub _is_low_precedence { 1 }
+
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Index.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Index.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Index.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -2,7 +2,7 @@
use Moose;
extends 'Catalyst::DispatchType';
-no Moose;
+use namespace::clean -except => 'meta';
=head1 NAME
@@ -25,6 +25,12 @@
=back
+=cut
+
+has _actions => (
+ is => 'rw', isa => 'HashRef', default => sub { +{} }
+);
+
=head1 METHODS
=head2 $self->match( $c, $path )
@@ -40,6 +46,8 @@
return if @{ $c->req->args };
my $result = $c->get_action( 'index', $path );
+ return 0 unless $result && exists $self->_actions->{ $result->reverse };
+
if ($result && $result->match($c)) {
$c->action($result);
$c->namespace( $result->namespace );
@@ -50,6 +58,20 @@
return 0;
}
+=head2 $self->register( $c, $action )
+
+Register an action with this DispatchType.
+
+=cut
+
+sub register {
+ my ( $self, $c, $action ) = @_;
+
+ $self->_actions->{ $action->reverse } = $action;
+
+ return 1;
+}
+
=head2 $self->uri_for_action( $action, $captures )
get a URI part for an action; always returns undef is $captures is set
@@ -67,6 +89,8 @@
return "/".$action->namespace;
}
+sub _is_low_precedence { 1 }
+
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Path.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Path.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Path.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -6,7 +6,6 @@
use Text::SimpleTable;
use Catalyst::Utils;
use URI;
-use Scalar::Util ();
has _paths => (
is => 'rw',
@@ -48,9 +47,11 @@
sub list {
my ( $self, $c ) = @_;
- my $column_width = Catalyst::Utils::term_width() - 35 - 9;
+ my $avail_width = Catalyst::Utils::term_width() - 9;
+ my $col1_width = ($avail_width * .50) < 35 ? 35 : int($avail_width * .50);
+ my $col2_width = $avail_width - $col1_width;
my $paths = Text::SimpleTable->new(
- [ 35, 'Path' ], [ $column_width, 'Private' ]
+ [ $col1_width, 'Path' ], [ $col2_width, 'Private' ]
);
foreach my $path ( sort keys %{ $self->_paths } ) {
my $display_path = $path eq '/' ? $path : "/$path";
@@ -62,16 +63,6 @@
if ( keys %{ $self->_paths } );
}
-sub _action_args_sort_order {
- my ( $self, $action ) = @_;
-
- my ($args) = @{ $action->attributes->{Args} || [] };
-
- return $args if Scalar::Util::looks_like_number($args);
-
- return ~0;
-}
-
=head2 $self->match( $c, $path )
For each action registered to this exact path, offers the action a chance to
@@ -85,10 +76,7 @@
$path = '/' if !defined $path || !length $path;
- # sort from least args to most
- my @actions = sort { $self->_action_args_sort_order($a) <=>
- $self->_action_args_sort_order($b) }
- @{ $self->_paths->{$path} || [] };
+ my @actions = @{ $self->_paths->{$path} || [] };
foreach my $action ( @actions ) {
next unless $action->match($c);
@@ -130,8 +118,11 @@
$path =~ s!^/!!;
$path = '/' unless length $path;
$path = URI->new($path)->canonical;
+ $path =~ s{(?<=[^/])/+\z}{};
- unshift( @{ $self->_paths->{$path} ||= [] }, $action);
+ $self->_paths->{$path} = [
+ sort { $a->compare($b) } ($action, @{ $self->_paths->{$path} || [] })
+ ];
return 1;
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Regex.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Regex.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType/Regex.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -47,8 +47,12 @@
sub list {
my ( $self, $c ) = @_;
- my $column_width = Catalyst::Utils::term_width() - 35 - 9;
- my $re = Text::SimpleTable->new( [ 35, 'Regex' ], [ $column_width, 'Private' ] );
+ my $avail_width = Catalyst::Utils::term_width() - 9;
+ my $col1_width = ($avail_width * .50) < 35 ? 35 : int($avail_width * .50);
+ my $col2_width = $avail_width - $col1_width;
+ my $re = Text::SimpleTable->new(
+ [ $col1_width, 'Regex' ], [ $col2_width, 'Private' ]
+ );
for my $regex ( @{ $self->_compiled } ) {
my $action = $regex->{action};
$re->row( $regex->{path}, "/$action" );
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/DispatchType.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -73,6 +73,8 @@
sub expand_action { }
+sub _is_low_precedence { 0 }
+
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Dispatcher.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Dispatcher.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -34,18 +34,15 @@
has _method_action_class => (is => 'rw', default => 'Catalyst::Action');
has _action_hash => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
has _container_hash => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
-has preload_dispatch_types => (is => 'rw', required => 1, lazy => 1, default => sub { [@PRELOAD] });
-has postload_dispatch_types => (is => 'rw', required => 1, lazy => 1, default => sub { [@POSTLOAD] });
+my %dispatch_types = ( pre => \@PRELOAD, post => \@POSTLOAD );
+foreach my $type (keys %dispatch_types) {
+ has $type . "load_dispatch_types" => (
+ is => 'rw', required => 1, lazy => 1, default => sub { $dispatch_types{$type} },
+ traits => ['MooseX::Emulate::Class::Accessor::Fast::Meta::Role::Attribute'], # List assignment is CAF style
+ );
+}
-# Wrap accessors so you can assign a list and it will capture a list ref.
-around qw/preload_dispatch_types postload_dispatch_types/ => sub {
- my $orig = shift;
- my $self = shift;
- return $self->$orig([@_]) if (scalar @_ && ref $_[0] ne 'ARRAY');
- return $self->$orig(@_);
-};
-
=head1 NAME
Catalyst::Dispatcher - The Catalyst Dispatcher
@@ -225,7 +222,7 @@
sub go {
my $self = shift;
$self->_do_visit('go', @_);
- die $Catalyst::GO;
+ Catalyst::Exception::Go->throw;
}
=head2 $self->forward( $c, $command [, \@arguments ] )
@@ -271,7 +268,7 @@
sub detach {
my ( $self, $c, $command, @args ) = @_;
$self->_do_forward(detach => $c, $command, @args ) if $command;
- die $Catalyst::DETACH;
+ Catalyst::Exception::Detach->throw;
}
sub _action_rel2abs {
@@ -338,7 +335,7 @@
reverse => "$component_class->$method",
class => $component_class,
namespace => Catalyst::Utils::class2prefix(
- $component_class, $c->config->{case_sensitive}
+ $component_class, ref($c)->config->{case_sensitive}
),
}
);
@@ -370,10 +367,8 @@
DESCEND: while (@path) {
$path = join '/', @path;
- $path =~ s#^/##;
+ $path =~ s#^/+##;
- $path = '' if $path eq '/'; # Root action
-
# Check out dispatch types to see if any will handle the path at
# this level
@@ -459,9 +454,6 @@
}
return reverse grep { defined } @containers, $self->_container_hash->{''};
-
- #return (split '/', $namespace); # isnt this more clear?
- my @parts = split '/', $namespace;
}
=head2 $self->uri_for_action($action, \@captures)
@@ -531,11 +523,30 @@
}
}
+ my @dtypes = @{ $self->_dispatch_types };
+ my @normal_dtypes;
+ my @low_precedence_dtypes;
+
+ for my $type ( @dtypes ) {
+ if ($type->_is_low_precedence) {
+ push @low_precedence_dtypes, $type;
+ } else {
+ push @normal_dtypes, $type;
+ }
+ }
+
# Pass the action to our dispatch types so they can register it if reqd.
- foreach my $type ( @{ $self->_dispatch_types } ) {
- $type->register( $c, $action );
+ my $was_registered = 0;
+ foreach my $type ( @normal_dtypes ) {
+ $was_registered = 1 if $type->register( $c, $action );
}
+ if (not $was_registered) {
+ foreach my $type ( @low_precedence_dtypes ) {
+ $type->register( $c, $action );
+ }
+ }
+
my $namespace = $action->namespace;
my $name = $action->name;
@@ -604,9 +615,12 @@
sub _display_action_tables {
my ($self, $c) = @_;
- my $column_width = Catalyst::Utils::term_width() - 20 - 36 - 12;
+ my $avail_width = Catalyst::Utils::term_width() - 12;
+ my $col1_width = ($avail_width * .25) < 20 ? 20 : int($avail_width * .25);
+ my $col2_width = ($avail_width * .50) < 36 ? 36 : int($avail_width * .50);
+ my $col3_width = $avail_width - $col1_width - $col2_width;
my $privates = Text::SimpleTable->new(
- [ 20, 'Private' ], [ 36, 'Class' ], [ $column_width, 'Method' ]
+ [ $col1_width, 'Private' ], [ $col2_width, 'Class' ], [ $col3_width, 'Method' ]
);
my $has_private = 0;
@@ -640,11 +654,10 @@
my ( $self, @types ) = @_;
my @loaded;
-
# Preload action types
for my $type (@types) {
- my $class =
- ( $type =~ /^\+(.*)$/ ) ? $1 : "Catalyst::DispatchType::${type}";
+ # first param is undef because we cannot get the appclass
+ my $class = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $type);
eval { Class::MOP::load_class($class) };
Catalyst::Exception->throw( message => qq/Couldn't load "$class"/ )
@@ -668,9 +681,8 @@
sub dispatch_type {
my ($self, $name) = @_;
- unless ($name =~ s/^\+//) {
- $name = "Catalyst::DispatchType::" . $name;
- }
+ # first param is undef because we cannot get the appclass
+ $name = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $name);
for (@{ $self->_dispatch_types }) {
return $_ if ref($_) eq $name;
@@ -685,10 +697,26 @@
# Various plugins (e.g. Plugin::Server and Plugin::Authorization::ACL)
# need the methods here which *should* be private..
-# However we can't really take them away until there is a sane API for
-# building actions and configuring / introspecting the dispatcher.
-# In 5.90, we should build that infrastructure, port the plugins which
-# use it, and then take the crap below away.
+# You should be able to use get_actions or get_containers appropriately
+# instead of relying on these methods which expose implementation details
+# of the dispatcher..
+#
+# IRC backlog included below, please come ask if this doesn't work for you.
+#
+# <@t0m> 5.80, the state of. There are things in the dispatcher which have
+# been deprecated, that we yell at anyone for using, which there isn't
+# a good alternative for yet..
+# <@mst> er, get_actions/get_containers provides that doesn't it?
+# <@mst> DispatchTypes are loaded on demand anyway
+# <@t0m> I'm thinking of things like _tree which is aliased to 'tree' with
+# warnings otherwise shit breaks.. We're issuing warnings about the
+# correct set of things which you shouldn't be calling..
+# <@mst> right
+# <@mst> basically, I don't see there's a need for a replacement for anything
+# <@mst> it was never a good idea to call ->tree
+# <@mst> nothingmuch was the only one who did AFAIK
+# <@mst> and he admitted it was a hack ;)
+
# See also t/lib/TestApp/Plugin/AddDispatchTypes.pm
# Alias _method_name to method_name, add a before modifier to warn..
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/CGI.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/CGI.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -57,9 +57,9 @@
PROXY_CHECK:
{
- unless ( $c->config->{using_frontend_proxy} ) {
+ unless ( ref($c)->config->{using_frontend_proxy} ) {
last PROXY_CHECK if $ENV{REMOTE_ADDR} ne '127.0.0.1';
- last PROXY_CHECK if $c->config->{ignore_frontend_proxy};
+ last PROXY_CHECK if ref($c)->config->{ignore_frontend_proxy};
}
last PROXY_CHECK unless $ENV{HTTP_X_FORWARDED_FOR};
@@ -67,6 +67,9 @@
# as 127.0.0.1. Select the most recent upstream IP (last in the list)
my ($ip) = $ENV{HTTP_X_FORWARDED_FOR} =~ /([^,\s]+)$/;
$request->address($ip);
+ if ( defined $ENV{HTTP_X_FORWARDED_PORT} ) {
+ $ENV{SERVER_PORT} = $ENV{HTTP_X_FORWARDED_PORT};
+ }
}
$request->hostname( $ENV{REMOTE_HOST} ) if exists $ENV{REMOTE_HOST};
@@ -123,9 +126,9 @@
# If we are running as a backend proxy, get the true hostname
PROXY_CHECK:
{
- unless ( $c->config->{using_frontend_proxy} ) {
+ unless ( ref($c)->config->{using_frontend_proxy} ) {
last PROXY_CHECK if $host !~ /localhost|127.0.0.1/;
- last PROXY_CHECK if $c->config->{ignore_frontend_proxy};
+ last PROXY_CHECK if ref($c)->config->{ignore_frontend_proxy};
}
last PROXY_CHECK unless $ENV{HTTP_X_FORWARDED_HOST};
@@ -134,6 +137,9 @@
# backend could be on any port, so
# assume frontend is on the default port
$port = $c->request->secure ? 443 : 80;
+ if ( $ENV{HTTP_X_FORWARDED_PORT} ) {
+ $port = $ENV{HTTP_X_FORWARDED_PORT};
+ }
}
# set the request URI
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/FastCGI.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/FastCGI.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/FastCGI.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -235,7 +235,7 @@
$env->{PATH_INFO} ||= delete $env->{SCRIPT_NAME};
}
# Fix the environment variables PATH_INFO and SCRIPT_NAME when running under IIS
- elsif ( $env->{SERVER_SOFTWARE} =~ /IIS\/[67].0/ ) {
+ elsif ( $env->{SERVER_SOFTWARE} =~ /IIS\/[6-9]\.[0-9]/ ) {
my @script_name = split(m!/!, $env->{PATH_INFO});
my @path_translated = split(m!/|\\\\?!, $env->{PATH_TRANSLATED});
my @path_info;
Deleted: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP/Restarter.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP/Restarter.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP/Restarter.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,135 +0,0 @@
-package Catalyst::Engine::HTTP::Restarter;
-use Moose;
-use Moose::Util qw/find_meta/;
-use namespace::clean -except => 'meta';
-
-extends 'Catalyst::Engine::HTTP';
-
-use Catalyst::Engine::HTTP::Restarter::Watcher;
-
-around run => sub {
- my $orig = shift;
- my ( $self, $class, $port, $host, $options ) = @_;
-
- $options ||= {};
-
- # Setup restarter
- unless ( my $restarter = fork ) {
-
- # Prepare
- close STDIN;
- close STDOUT;
-
- # Avoid "Setting config after setup" error restarting MyApp.pm
- $class->setup_finished(0);
- # Best effort if we can't trap compiles..
- $self->_make_components_mutable($class)
- if !Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION;
-
- my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new(
- directory => (
- $options->{restart_directory} ||
- File::Spec->catdir( $FindBin::Bin, '..' )
- ),
- follow_symlinks => $options->{follow_symlinks},
- regex => $options->{restart_regex},
- delay => $options->{restart_delay},
- );
-
- $host ||= '127.0.0.1';
- while (1) {
-
- # poll for changed files
- my @changed_files = $watcher->watch();
-
- # check if our parent process has died
- exit if $^O ne 'MSWin32' and getppid == 1;
-
- # Restart if any files have changed
- if (@changed_files) {
- my $files = join ', ', @changed_files;
- print STDERR qq/File(s) "$files" modified, restarting\n\n/;
-
- require IO::Socket::INET;
- require HTTP::Headers;
- require HTTP::Request;
-
- my $client = IO::Socket::INET->new(
- PeerAddr => $host,
- PeerPort => $port
- )
- or die "Can't create client socket (is server running?): ",
- $!;
-
- # build the Kill request
- my $req =
- HTTP::Request->new( 'RESTART', '/',
- HTTP::Headers->new( 'Connection' => 'close' ) );
- $req->protocol('HTTP/1.0');
-
- $client->send( $req->as_string )
- or die "Can't send restart instruction: ", $!;
- $client->close();
- exit;
- }
- }
- }
-
- return $self->$orig( $class, $port, $host, $options );
-};
-
-# Naive way of trying to avoid Moose blowing up when you re-require components
-# which have been made immutable.
-sub _make_components_mutable {
- my ($self, $class) = @_;
-
- my @metas = grep { defined($_) }
- map { find_meta($_) }
- ($class, map { blessed($_) }
- values %{ $class->components });
-
- foreach my $meta (@metas) {
- # Paranoia unneeded, all component metaclasses should have immutable
- $meta->make_mutable if $meta->is_immutable;
- }
-}
-
-1;
-__END__
-
-=head1 NAME
-
-Catalyst::Engine::HTTP::Restarter - Catalyst Auto-Restarting HTTP Engine
-
-=head1 SYNOPSIS
-
- script/myapp_server.pl -restart
-
-=head1 DESCRIPTION
-
-The Restarter engine will monitor files in your application for changes
-and restart the server when any changes are detected.
-
-=head1 METHODS
-
-=head2 run
-
-=head1 SEE ALSO
-
-L<Catalyst>, L<Catalyst::Engine::HTTP>, L<Catalyst::Engine::CGI>,
-L<Catalyst::Engine>.
-
-=head1 AUTHORS
-
-Catalyst Contributors, see Catalyst.pm
-
-=head1 THANKS
-
-Many parts are ripped out of C<HTTP::Server::Simple> by Jesse Vincent.
-
-=head1 COPYRIGHT
-
-This library is free software. You can redistribute it and/or modify it under
-the same terms as Perl itself.
-
-=cut
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine/HTTP.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -12,10 +12,6 @@
use IO::Socket::INET ();
use IO::Select ();
-# For PAR
-require Catalyst::Engine::HTTP::Restarter;
-require Catalyst::Engine::HTTP::Restarter::Watcher;
-
use constant CHUNKSIZE => 64 * 1024;
use constant DEBUG => $ENV{CATALYST_HTTP_DEBUG} || 0;
@@ -158,11 +154,16 @@
# Prepend the headers if they have not yet been sent
if ( $self->_has_header_buf ) {
- $buffer = $self->_clear_header_buf . $buffer;
+ $self->_warn_on_write_error(
+ $self->$orig($c, $self->_clear_header_buf)
+ );
}
- my $ret = $self->$orig($c, $buffer);
+ $self->_warn_on_write_error($self->$orig($c, $buffer));
+};
+sub _warn_on_write_error {
+ my ($self, $ret) = @_;
if ( !defined $ret ) {
$self->_write_error($!);
DEBUG && warn "write: Failed to write response ($!)\n";
@@ -170,9 +171,8 @@
else {
DEBUG && warn "write: Wrote response ($ret bytes)\n";
}
-
return $ret;
-};
+}
=head2 run
@@ -364,6 +364,9 @@
while (1) {
my ( $path, $query_string ) = split /\?/, $uri, 2;
+ # URI is not the same as path. Remove scheme, domain name and port from it
+ $path =~ s{^https?://[^/?#]+}{};
+
# Initialize CGI environment
local %ENV = (
PATH_INFO => $path || '',
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Engine.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -48,10 +48,12 @@
my $body = $c->response->body;
no warnings 'uninitialized';
if ( blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) {
- while ( !eof $body ) {
- read $body, my ($buffer), $CHUNKSIZE;
- last unless $self->write( $c, $buffer );
- }
+ my $got;
+ do {
+ $got = read $body, my ($buffer), $CHUNKSIZE;
+ $got = 0 unless $self->write( $c, $buffer );
+ } while $got > 0;
+
close $body;
}
else {
@@ -110,7 +112,7 @@
my ( $self, $c ) = @_;
$c->res->content_type('text/html; charset=utf-8');
- my $name = $c->config->{name} || join(' ', split('::', ref $c));
+ my $name = ref($c)->config->{name} || join(' ', split('::', ref $c));
my ( $title, $error, $infos );
if ( $c->debug ) {
@@ -315,13 +317,14 @@
sub prepare_body {
my ( $self, $c ) = @_;
+ my $appclass = ref($c) || $c;
if ( my $length = $self->read_length ) {
my $request = $c->request;
unless ( $request->_body ) {
my $type = $request->header('Content-Type');
$request->_body(HTTP::Body->new( $type, $length ));
- $request->_body->tmpdir( $c->config->{uploadtmp} )
- if exists $c->config->{uploadtmp};
+ $request->_body->tmpdir( $appclass->config->{uploadtmp} )
+ if exists $appclass->config->{uploadtmp};
}
while ( my $buffer = $self->read($c) ) {
Added: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Detach.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Detach.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Detach.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,22 @@
+package Catalyst::Exception::Detach;
+
+use Moose;
+use namespace::clean -except => 'meta';
+
+extends 'Catalyst::Exception';
+
+has '+message' => (
+ default => "catalyst_detach\n",
+);
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Exception::Detach - Exception for redispatching using $ctx->detach()
+
+=cut
Added: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Go.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Go.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception/Go.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,22 @@
+package Catalyst::Exception::Go;
+
+use Moose;
+use namespace::clean -except => 'meta';
+
+extends 'Catalyst::Exception';
+
+has '+message' => (
+ default => "catalyst_go\n",
+);
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Exception::Go - Exception for redispatching using $ctx->go()
+
+=cut
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Exception.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -5,7 +5,8 @@
package Catalyst::Exception::Base;
use Moose;
-use Carp ();
+use Carp;
+use namespace::clean -except => 'meta';
=head1 NAME
@@ -33,15 +34,44 @@
=cut
-sub throw {
- my $class = shift;
- my %params = @_ == 1 ? ( error => $_[0] ) : @_;
+has message => (
+ is => 'ro',
+ isa => 'Str',
+ default => sub { $! || '' },
+);
- my $message = $params{message} || $params{error} || $! || '';
+use overload
+ q{""} => \&as_string,
+ fallback => 1;
+sub as_string {
+ my ($self) = @_;
+ return $self->message;
+}
+
+around BUILDARGS => sub {
+ my ($next, $class, @args) = @_;
+ if (@args == 1 && !ref $args[0]) {
+ @args = (message => $args[0]);
+ }
+
+ my $args = $class->$next(@args);
+ $args->{message} ||= $args->{error}
+ if exists $args->{error};
+
+ return $args;
+};
+
+sub throw {
+ my $class = shift;
+ my $error = $class->new(@_);
local $Carp::CarpLevel = 1;
+ croak $error;
+}
- Carp::croak($message);
+sub rethrow {
+ my ($self) = @_;
+ croak $self;
}
=head2 meta
@@ -64,13 +94,14 @@
package Catalyst::Exception;
use Moose;
+use namespace::clean -except => 'meta';
+
use vars qw[$CATALYST_EXCEPTION_CLASS];
BEGIN {
extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
}
-no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Request.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Request.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -223,7 +223,7 @@
=head2 $req->args
-Shortcut for arguments.
+Shortcut for L</arguments>.
=head2 $req->base
@@ -237,8 +237,9 @@
=head2 $req->body
-Returns the message body of the request, unless Content-Type is
-C<application/x-www-form-urlencoded> or C<multipart/form-data>.
+Returns the message body of the request, as returned by L<HTTP::Body>: a string,
+unless Content-Type is C<application/x-www-form-urlencoded>, C<text/xml>, or
+C<multipart/form-data>, in which case a L<File::Temp> object is returned.
=head2 $req->body_parameters
@@ -300,7 +301,7 @@
print $c->request->cookies->{mycookie}->value;
-The cookies in the hash are indexed by name, and the values are L<CGI::Cookie>
+The cookies in the hash are indexed by name, and the values are L<CGI::Simple::Cookie>
objects.
=head2 $req->header
@@ -473,7 +474,7 @@
used in a while loop, reading $maxlength bytes on every call. $maxlength
defaults to the size of the request if not specified.
-You have to set MyApp->config->{parse_on_demand} to use this directly.
+You have to set MyApp->config(parse_on_demand => 1) to use this directly.
=head2 $req->referer
@@ -571,19 +572,35 @@
Returns a URI object for the current request. Stringifies to the URI text.
-=head2 $req->uri_with( { key => 'value' } );
+=head2 $req->mangle_params( { key => 'value' }, $appendmode);
-Returns a rewritten URI object for the current request. Key/value pairs
-passed in will override existing parameters. You can remove an existing
-parameter by passing in an undef value. Unmodified pairs will be
-preserved.
+Returns a hashref of parameters stemming from the current request's params,
+plus the ones supplied. Keys for which no current param exists will be
+added, keys with undefined values will be removed and keys with existing
+params will be replaced. Note that you can supply a true value as the final
+argument to change behavior with regards to existing parameters, appending
+values rather than replacing them.
+A quick example:
+
+ # URI query params foo=1
+ my $hashref = $req->mangle_params({ foo => 2 });
+ # Result is query params of foo=2
+
+versus append mode:
+
+ # URI query params foo=1
+ my $hashref = $req->mangle_params({ foo => 2 }, 1);
+ # Result is query params of foo=1&foo=2
+
+This is the code behind C<uri_with>.
+
=cut
-sub uri_with {
- my( $self, $args ) = @_;
+sub mangle_params {
+ my ($self, $args, $append) = @_;
- carp( 'No arguments passed to uri_with()' ) unless $args;
+ carp('No arguments passed to mangle_params()') unless $args;
foreach my $value ( values %$args ) {
next unless defined $value;
@@ -593,13 +610,66 @@
}
};
- my $uri = $self->uri->clone;
- my %query = ( %{ $uri->query_form_hash }, %$args );
+ my %params = %{ $self->uri->query_form_hash };
+ foreach my $key (keys %{ $args }) {
+ my $val = $args->{$key};
+ if(defined($val)) {
- $uri->query_form( {
- # remove undef values
- map { defined $query{ $_ } ? ( $_ => $query{ $_ } ) : () } keys %query
- } );
+ if($append && exists($params{$key})) {
+
+ # This little bit of heaven handles appending a new value onto
+ # an existing one regardless if the existing value is an array
+ # or not, and regardless if the new value is an array or not
+ $params{$key} = [
+ ref($params{$key}) eq 'ARRAY' ? @{ $params{$key} } : $params{$key},
+ ref($val) eq 'ARRAY' ? @{ $val } : $val
+ ];
+
+ } else {
+ $params{$key} = $val;
+ }
+ } else {
+
+ # If the param wasn't defined then we delete it.
+ delete($params{$key});
+ }
+ }
+
+
+ return \%params;
+}
+
+=head2 $req->uri_with( { key => 'value' } );
+
+Returns a rewritten URI object for the current request. Key/value pairs
+passed in will override existing parameters. You can remove an existing
+parameter by passing in an undef value. Unmodified pairs will be
+preserved.
+
+You may also pass an optional second parameter that puts C<uri_with> into
+append mode:
+
+ $req->uri_with( { key => 'value' }, { mode => 'append' } );
+
+See C<mangle_params> for an explanation of this behavior.
+
+=cut
+
+sub uri_with {
+ my( $self, $args, $behavior) = @_;
+
+ carp( 'No arguments passed to uri_with()' ) unless $args;
+
+ my $append = 0;
+ if((ref($behavior) eq 'HASH') && defined($behavior->{mode}) && ($behavior->{mode} eq 'append')) {
+ $append = 1;
+ }
+
+ my $params = $self->mangle_params($args, $append);
+
+ my $uri = $self->uri->clone;
+ $uri->query_form($params);
+
return $uri;
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Response.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Response.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Response.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -6,7 +6,14 @@
with 'MooseX::Emulate::Class::Accessor::Fast';
has cookies => (is => 'rw', default => sub { {} });
-has body => (is => 'rw', default => '', lazy => 1, predicate => 'has_body');
+has body => (is => 'rw', default => '', lazy => 1, predicate => 'has_body',
+ clearer => '_clear_body'
+);
+after 'body' => sub { # If someone assigned undef, clear the body so we get ''
+ if (scalar(@_) == 2 && !defined($_[1])) {
+ $_[0]->_clear_body;
+ }
+};
has location => (is => 'rw');
has status => (is => 'rw', default => 200);
has finalized_headers => (is => 'rw', default => 0);
@@ -95,11 +102,11 @@
Returns a reference to a hash containing cookies to be set. The keys of the
hash are the cookies' names, and their corresponding values are hash
-references used to construct a L<CGI::Cookie> object.
+references used to construct a L<CGI::Simple::Cookie> object.
$c->response->cookies->{foo} = { value => '123' };
-The keys of the hash reference on the right correspond to the L<CGI::Cookie>
+The keys of the hash reference on the right correspond to the L<CGI::Simple::Cookie>
parameters of the same name, except they are used without a leading dash.
Possible parameters are:
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Runtime.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Runtime.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Runtime.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -3,11 +3,11 @@
use strict;
use warnings;
-BEGIN { require 5.008001; }
+BEGIN { require 5.008004; }
# Remember to update this in Catalyst as well!
-our $VERSION='5.80005';
+our $VERSION='5.80011';
$VERSION = eval $VERSION;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Stats.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Stats.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Stats.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -84,6 +84,10 @@
return $node->getUID;
}
+sub created {
+ return @{ shift->{tree}->getNodeValue->{t} };
+}
+
sub elapsed {
return tv_interval(shift->{tree}->getNodeValue->{t});
}
@@ -297,6 +301,13 @@
Returns the UID of the current point in the profile tree. The UID is
automatically assigned if not explicitly given.
+=head2 created
+
+ ($seconds, $microseconds) = $stats->created;
+
+Returns the time the object was created, in C<gettimeofday> format, with
+Unix epoch seconds followed by microseconds.
+
=head2 elapsed
$elapsed = $stats->elapsed
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Test.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Test.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Test.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -31,7 +31,7 @@
my $get = sub { $request->(@_)->content };
my $ctx_request = sub {
- my $me = ref $self || $self;
+ my $me = ref $self || $self;
### throw an exception if ctx_request is being used against a remote
### server
@@ -49,13 +49,13 @@
### hook into 'dispatch' -- the function gets called after all plugins
### have done their work, and it's an easy place to capture $c.
- my $meta = Catalyst->meta;
+ my $meta = Class::MOP::get_metaclass_by_name($class);
$meta->make_mutable;
$meta->add_after_method_modifier( "dispatch", sub {
$c = shift;
});
- $meta->make_immutable;
-
+ $meta->make_immutable( replace_constructor => 1 );
+ Class::C3::reinitialize(); # Fixes RT#46459, I've failed to write a test for how/why, but it does.
### do the request; C::T::request will know about the class name, and
### we've already stopped it from doing remote requests above.
my $res = $request->( @_ );
@@ -156,8 +156,8 @@
environment variable. This module also adds a few Catalyst-specific
testing methods as displayed in the method section.
-The L<get> and L<request> functions take either a URI or an L<HTTP::Request>
-object.
+The L<get|/"$content = get( ... )"> and L<request|/"$res = request( ... );">
+functions take either a URI or an L<HTTP::Request> object.
=head1 INLINE TESTS WILL NO LONGER WORK
@@ -187,7 +187,7 @@
Note that this method doesn't follow redirects, so to test for a
correctly redirecting page you'll need to use a combination of this
-method and the L<request> method below:
+method and the L<request|/"$res = request( ... );"> method below:
my $res = request('/'); # redirects to /y
warn $res->header('location');
@@ -208,7 +208,7 @@
=head2 ($res, $c) = ctx_request( ... );
-Works exactly like L<request>, except it also returns the Catalyst context object,
+Works exactly like L<request|/"$res = request( ... );">, except it also returns the Catalyst context object,
C<$c>. Note that this only works for local requests.
=head2 $res = Catalyst::Test::local_request( $AppClass, $url );
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Utils.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Utils.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Utils.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -9,6 +9,8 @@
use Carp qw/croak/;
use Cwd;
+use String::RewritePrefix;
+
use namespace::clean;
=head1 NAME
@@ -377,6 +379,33 @@
return $_term_width = $width;
}
+
+=head2 resolve_namespace
+
+Method which adds the namespace for plugins and actions.
+
+ __PACKAGE__->setup(qw(MyPlugin));
+
+ # will load Catalyst::Plugin::MyPlugin
+
+=cut
+
+
+sub resolve_namespace {
+ my $appnamespace = shift;
+ my $namespace = shift;
+ my @classes = @_;
+ return String::RewritePrefix->rewrite({
+ q[] => qq[${namespace}::],
+ q[+] => q[],
+ (defined $appnamespace
+ ? (q[~] => qq[${appnamespace}::])
+ : ()
+ ),
+ }, @classes);
+}
+
+
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -7,6 +7,8 @@
use bytes;
use B::Hooks::EndOfScope ();
use Catalyst::Exception;
+use Catalyst::Exception::Detach;
+use Catalyst::Exception::Go;
use Catalyst::Log;
use Catalyst::Request;
use Catalyst::Request::Upload;
@@ -25,11 +27,12 @@
use Tree::Simple qw/use_weak_refs/;
use Tree::Simple::Visitor::FindByUID;
use Class::C3::Adopt::NEXT;
+use List::MoreUtils qw/uniq/;
use attributes;
use utf8;
use Carp qw/croak carp shortmess/;
-BEGIN { require 5.008001; }
+BEGIN { require 5.008004; }
has stack => (is => 'ro', default => sub { [] });
has stash => (is => 'rw', default => sub { {} });
@@ -58,8 +61,8 @@
our $COUNT = 1;
our $START = time;
our $RECURSION = 1000;
-our $DETACH = "catalyst_detach\n";
-our $GO = "catalyst_go\n";
+our $DETACH = Catalyst::Exception::Detach->new;
+our $GO = Catalyst::Exception::Go->new;
#I imagine that very few of these really need to be class variables. if any.
#maybe we should just make them attributes with a default?
@@ -76,7 +79,7 @@
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.80005';
+our $VERSION = '5.80011';
{
my $dev_version = $VERSION =~ /_\d{2}$/;
@@ -101,12 +104,13 @@
}
my $meta = Moose::Meta::Class->initialize($caller);
- #Moose->import({ into => $caller }); #do we want to do this?
-
unless ( $caller->isa('Catalyst') ) {
my @superclasses = ($meta->superclasses, $class, 'Catalyst::Controller');
$meta->superclasses(@superclasses);
}
+ # Avoid possible C3 issues if 'Moose::Object' is already on RHS of MyApp
+ $meta->superclasses(grep { $_ ne 'Moose::Object' } $meta->superclasses);
+
unless( $meta->has_method('meta') ){
$meta->add_method(meta => sub { Moose::Meta::Class->initialize("${caller}") } );
}
@@ -115,6 +119,8 @@
$caller->setup_home;
}
+sub _application { $_[0] }
+
=head1 NAME
Catalyst - The Elegant MVC Web Application Framework
@@ -330,9 +336,11 @@
$c->forward(qw/MyApp::Model::DBIC::Foo do_stuff/);
$c->forward('MyApp::View::TT');
-Note that forward implies an C<<eval { }>> around the call (actually
-C<execute> does), thus de-fatalizing all 'dies' within the called
-action. If you want C<die> to propagate you need to do something like:
+Note that L<< forward|/"$c->forward( $action [, \@arguments ] )" >> implies
+an C<< eval { } >> around the call (actually
+L<< execute|/"$c->execute( $class, $coderef )" >> does), thus de-fatalizing
+all 'dies' within the called action. If you want C<die> to propagate you
+need to do something like:
$c->forward('foo');
die $c->error if $c->error;
@@ -352,8 +360,8 @@
=head2 $c->detach()
-The same as C<forward>, but doesn't return to the previous action when
-processing is finished.
+The same as L<< forward|/"$c->forward( $action [, \@arguments ] )" >>, but
+doesn't return to the previous action when processing is finished.
When called with no arguments it escapes the processing chain entirely.
@@ -365,23 +373,27 @@
=head2 $c->visit( $class, $method, [, \@captures, \@arguments ] )
-Almost the same as C<forward>, but does a full dispatch, instead of just
-calling the new C<$action> / C<$class-E<gt>$method>. This means that C<begin>,
-C<auto> and the method you go to are called, just like a new request.
+Almost the same as L<< forward|/"$c->forward( $action [, \@arguments ] )" >>,
+but does a full dispatch, instead of just calling the new C<$action> /
+C<< $class->$method >>. This means that C<begin>, C<auto> and the method
+you go to are called, just like a new request.
In addition both C<< $c->action >> and C<< $c->namespace >> are localized.
-This means, for example, that $c->action methods such as C<name>, C<class> and
-C<reverse> return information for the visited action when they are invoked
-within the visited action. This is different from the behavior of C<forward>
-which continues to use the $c->action object from the caller action even when
+This means, for example, that C<< $c->action >> methods such as
+L<name|Catalyst::Action/name>, L<class|Catalyst::Action/class> and
+L<reverse|Catalyst::Action/reverse> return information for the visited action
+when they are invoked within the visited action. This is different from the
+behavior of L<< forward|/"$c->forward( $action [, \@arguments ] )" >>, which
+continues to use the $c->action object from the caller action even when
invoked from the callee.
-C<$c-E<gt>stash> is kept unchanged.
+C<< $c->stash >> is kept unchanged.
-In effect, C<visit> allows you to "wrap" another action, just as it
-would have been called by dispatching from a URL, while the analogous
-C<go> allows you to transfer control to another action as if it had
-been reached directly from a URL.
+In effect, L<< visit|/"$c->visit( $action [, \@captures, \@arguments ] )" >>
+allows you to "wrap" another action, just as it would have been called by
+dispatching from a URL, while the analogous
+L<< go|/"$c->go( $action [, \@captures, \@arguments ] )" >> allows you to
+transfer control to another action as if it had been reached directly from a URL.
=cut
@@ -391,12 +403,12 @@
=head2 $c->go( $class, $method, [, \@captures, \@arguments ] )
-Almost the same as C<detach>, but does a full dispatch like C<visit>,
+Almost the same as L<< detach|/"$c->detach( $action [, \@arguments ] )" >>, but does a full dispatch like L</visit>,
instead of just calling the new C<$action> /
-C<$class-E<gt>$method>. This means that C<begin>, C<auto> and the
+C<< $class->$method >>. This means that C<begin>, C<auto> and the
method you visit are called, just like a new request.
-C<$c-E<gt>stash> is kept unchanged.
+C<< $c->stash >> is kept unchanged.
=cut
@@ -634,7 +646,7 @@
sub model {
my ( $c, $name, @args ) = @_;
-
+ my $appclass = ref($c) || $c;
if( $name ) {
my @result = $c->_comp_search_prefixes( $name, qw/Model M/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@ -647,14 +659,14 @@
return $c->model( $c->stash->{current_model} )
if $c->stash->{current_model};
}
- return $c->model( $c->config->{default_model} )
- if $c->config->{default_model};
+ return $c->model( $appclass->config->{default_model} )
+ if $appclass->config->{default_model};
my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/Model M/);
if( $rest ) {
$c->log->warn( Carp::shortmess('Calling $c->model() will return a random model unless you specify one of:') );
- $c->log->warn( '* $c->config->{default_model} # the name of the default model to use' );
+ $c->log->warn( '* $c->config(default_model => "the name of the default model to use")' );
$c->log->warn( '* $c->stash->{current_model} # the name of the model to use for this request' );
$c->log->warn( '* $c->stash->{current_model_instance} # the instance of the model to use for this request' );
$c->log->warn( 'NB: in version 5.81, the "random" behavior will not work at all.' );
@@ -688,6 +700,7 @@
sub view {
my ( $c, $name, @args ) = @_;
+ my $appclass = ref($c) || $c;
if( $name ) {
my @result = $c->_comp_search_prefixes( $name, qw/View V/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@ -700,14 +713,14 @@
return $c->view( $c->stash->{current_view} )
if $c->stash->{current_view};
}
- return $c->view( $c->config->{default_view} )
- if $c->config->{default_view};
+ return $c->view( $appclass->config->{default_view} )
+ if $appclass->config->{default_view};
my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/View V/);
if( $rest ) {
$c->log->warn( 'Calling $c->view() will return a random view unless you specify one of:' );
- $c->log->warn( '* $c->config->{default_view} # the name of the default view to use' );
+ $c->log->warn( '* $c->config(default_view => "the name of the default view to use")' );
$c->log->warn( '* $c->stash->{current_view} # the name of the view to use for this request' );
$c->log->warn( '* $c->stash->{current_view_instance} # the instance of the view to use for this request' );
$c->log->warn( 'NB: in version 5.81, the "random" behavior will not work at all.' );
@@ -813,11 +826,11 @@
__PACKAGE__->config( { db => 'dsn:SQLite:foo.db' } );
-You can also use a C<YAML>, C<XML> or C<Config::General> config file
-like myapp.conf in your applications home directory. See
+You can also use a C<YAML>, C<XML> or L<Config::General> config file
+like C<myapp.conf> in your applications home directory. See
L<Catalyst::Plugin::ConfigLoader>.
-=head3 Cascading configuration.
+=head3 Cascading configuration
The config method is present on all Catalyst components, and configuration
will be merged when an application is started. Configuration loaded with
@@ -913,7 +926,7 @@
Merges C<@path> with C<< $c->config->{home} >> and returns a
L<Path::Class::Dir> object. Note you can usually use this object as
a filename, but sometimes you will have to explicitly stringify it
-yourself by calling the C<<->stringify>> method.
+yourself by calling the C<< ->stringify >> method.
For example:
@@ -1104,21 +1117,25 @@
$class->log->_flush() if $class->log->can('_flush');
# Make sure that the application class becomes immutable at this point,
- # which ensures that it gets an inlined constructor. This means that it
- # works even if the user has added a plugin which contains a new method.
- # Note however that we have to do the work on scope end, so that method
- # modifiers work correctly in MyApp (as you have to call setup _before_
- # applying modifiers).
B::Hooks::EndOfScope::on_scope_end {
return if $@;
my $meta = Class::MOP::get_metaclass_by_name($class);
- if ( $meta->is_immutable && ! { $meta->immutable_options }->{inline_constructor} ) {
+ if (
+ $meta->is_immutable
+ && ! { $meta->immutable_options }->{replace_constructor}
+ && (
+ $class->isa('Class::Accessor::Fast')
+ || $class->isa('Class::Accessor')
+ )
+ ) {
warn "You made your application class ($class) immutable, "
- . "but did not inline the constructor.\n"
- . "This will break catalyst, please pass "
- . "(replace_constructor => 1) when making your class immutable.\n";
+ . "but did not inline the\nconstructor. "
+ . "This will break catalyst, as your app \@ISA "
+ . "Class::Accessor(::Fast)?\nPlease pass "
+ . "(replace_constructor => 1)\nwhen making your class immutable.\n";
}
- $meta->make_immutable(replace_constructor => 1) unless $meta->is_immutable;
+ $meta->make_immutable(replace_constructor => 1)
+ unless $meta->is_immutable;
};
$class->setup_finalize;
@@ -1149,36 +1166,54 @@
$class->setup_finished(1);
}
+=head2 $c->uri_for( $path, @args?, \%query_values? )
+
=head2 $c->uri_for( $action, \@captures?, @args?, \%query_values? )
-=head2 $c->uri_for( $path, @args?, \%query_values? )
+Constructs an absolute L<URI> object based on the application root, the
+provided path, and the additional arguments and query parameters provided.
+When used as a string, provides a textual URI.
-=over
+If the first argument is a string, it is taken as a public URI path relative
+to C<< $c->namespace >> (if it doesn't begin with a forward slash) or
+relative to the application root (if it does). It is then merged with
+C<< $c->request->base >>; any C<@args> are appended as additional path
+components; and any C<%query_values> are appended as C<?foo=bar> parameters.
-=item $action
+If the first argument is a L<Catalyst::Action> it represents an action which
+will have its path resolved using C<< $c->dispatcher->uri_for_action >>. The
+optional C<\@captures> argument (an arrayref) allows passing the captured
+variables that are needed to fill in the paths of Chained and Regex actions;
+once the path is resolved, C<uri_for> continues as though a path was
+provided, appending any arguments or parameters and creating an absolute
+URI.
-A Catalyst::Action object representing the Catalyst action you want to
-create a URI for. To get one for an action in the current controller,
-use C<< $c->action('someactionname') >>. To get one from different
-controller, fetch the controller using C<< $c->controller() >>, then
-call C<action_for> on it.
+The captures for the current request can be found in
+C<< $c->request->captures >>, and actions can be resolved using
+C<< Catalyst::Controller->action_for($name) >>. If you have a private action
+path, use C<< $c->uri_for_action >> instead.
-You can maintain the arguments captured by an action (e.g.: Regex, Chained)
-using C<< $c->req->captures >>.
+ # Equivalent to $c->req->uri
+ $c->uri_for($c->action, $c->req->captures,
+ @{ $c->req->args }, $c->req->params);
- # For the current action
- $c->uri_for($c->action, $c->req->captures);
-
# For the Foo action in the Bar controller
- $c->uri_for($c->controller('Bar')->action_for('Foo'), $c->req->captures);
+ $c->uri_for($c->controller('Bar')->action_for('Foo'));
-=back
+ # Path to a static resource
+ $c->uri_for('/static/images/logo.png');
=cut
sub uri_for {
my ( $c, $path, @args ) = @_;
+ if (blessed($path) && $path->isa('Catalyst::Controller')) {
+ $path = $path->path_prefix;
+ $path =~ s{/+\z}{};
+ $path .= '/';
+ }
+
if ( blessed($path) ) { # action object
my $captures = ( scalar @args && ref $args[0] eq 'ARRAY'
? shift(@args)
@@ -1230,12 +1265,12 @@
my $key = $_;
$val = '' unless defined $val;
(map {
- $_ = "$_";
- utf8::encode( $_ ) if utf8::is_utf8($_);
+ my $param = "$_";
+ utf8::encode( $param ) if utf8::is_utf8($param);
# using the URI::Escape pattern here so utf8 chars survive
- s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go;
- s/ /+/g;
- "${key}=$_"; } ( ref $val eq 'ARRAY' ? @$val : $val ));
+ $param =~ s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go;
+ $param =~ s/ /+/g;
+ "${key}=$param"; } ( ref $val eq 'ARRAY' ? @$val : $val ));
} @keys);
}
@@ -1509,11 +1544,11 @@
my $last = pop( @{ $c->stack } );
if ( my $error = $@ ) {
- if ( !ref($error) and $error eq $DETACH ) {
- die $DETACH if($c->depth > 1);
+ if ( blessed($error) and $error->isa('Catalyst::Exception::Detach') ) {
+ $error->rethrow if $c->depth > 1;
}
- elsif ( !ref($error) and $error eq $GO ) {
- die $GO if($c->depth > 0);
+ elsif ( blessed($error) and $error->isa('Catalyst::Exception::Go') ) {
+ $error->rethrow if $c->depth > 0;
}
else {
unless ( ref $error ) {
@@ -1532,9 +1567,9 @@
sub _stats_start_execute {
my ( $c, $code ) = @_;
-
+ my $appclass = ref($c) || $c;
return if ( ( $code->name =~ /^_.*/ )
- && ( !$c->config->{show_internal_actions} ) );
+ && ( !$appclass->config->{show_internal_actions} ) );
my $action_name = $code->reverse();
$c->counter->{$action_name}++;
@@ -1597,25 +1632,6 @@
$c->stats->profile( end => $info );
}
-=head2 $c->_localize_fields( sub { }, \%keys );
-
-=cut
-
-#Why does this exist? This is no longer safe and WILL NOT WORK.
-# it doesnt seem to be used anywhere. can we remove it?
-sub _localize_fields {
- my ( $c, $localized, $code ) = ( @_ );
-
- my $request = delete $localized->{request} || {};
- my $response = delete $localized->{response} || {};
-
- local @{ $c }{ keys %$localized } = values %$localized;
- local @{ $c->request }{ keys %$request } = values %$request;
- local @{ $c->response }{ keys %$response } = values %$response;
-
- $code->();
-}
-
=head2 $c->finalize
Finalizes the request.
@@ -1867,7 +1883,7 @@
$c->prepare_read;
# Parse the body unless the user wants it on-demand
- unless ( $c->config->{parse_on_demand} ) {
+ unless ( ref($c)->config->{parse_on_demand} ) {
$c->prepare_body;
}
}
@@ -2081,7 +2097,7 @@
be used in a while loop, reading C<$maxlength> bytes on every call.
C<$maxlength> defaults to the size of the request if not specified.
-You have to set C<< MyApp->config->{parse_on_demand} >> to use this
+You have to set C<< MyApp->config(parse_on_demand => 1) >> to use this
directly.
Warning: If you use read(), Catalyst will not process the body,
@@ -2118,40 +2134,32 @@
=head2 $c->setup_components
-Sets up components. Specify a C<setup_components> config option to pass
-additional options directly to L<Module::Pluggable>. To add additional
-search paths, specify a key named C<search_extra> as an array
-reference. Items in the array beginning with C<::> will have the
-application class name prepended to them.
+This method is called internally to set up the application's components.
-All components found will also have any
-L<Devel::InnerPackage|inner packages> loaded and set up as components.
-Note, that modules which are B<not> an I<inner package> of the main
-file namespace loaded will not be instantiated as components.
+It finds modules by calling the L<locate_components> method, expands them to
+package names with the L<expand_component_module> method, and then installs
+each component into the application.
+The C<setup_components> config option is passed to both of the above methods.
+
+Installation of each component is performed by the L<setup_component> method,
+below.
+
=cut
sub setup_components {
my $class = shift;
- my @paths = qw( ::Controller ::C ::Model ::M ::View ::V );
my $config = $class->config->{ setup_components };
- my $extra = delete $config->{ search_extra } || [];
- push @paths, @$extra;
-
- my $locator = Module::Pluggable::Object->new(
- search_path => [ map { s/^(?=::)/$class/; $_; } @paths ],
- %$config
- );
-
- my @comps = sort { length $a <=> length $b } $locator->plugins;
+ my @comps = sort { length $a <=> length $b }
+ $class->locate_components($config);
my %comps = map { $_ => 1 } @comps;
- my $deprecated_component_names = grep { /::[CMV]::/ } @comps;
+ my $deprecatedcatalyst_component_names = grep { /::[CMV]::/ } @comps;
$class->log->warn(qq{Your application is using the deprecated ::[MVC]:: type naming scheme.\n}.
qq{Please switch your class names to ::Model::, ::View:: and ::Controller: as appropriate.\n}
- ) if $deprecated_component_names;
+ ) if $deprecatedcatalyst_component_names;
for my $component ( @comps ) {
@@ -2160,30 +2168,76 @@
# we know M::P::O found a file on disk so this is safe
Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } );
- #Class::MOP::load_class($component);
- my $module = $class->setup_component( $component );
- my %modules = (
- $component => $module,
- map {
- $_ => $class->setup_component( $_ )
- } grep {
- not exists $comps{$_}
- } Devel::InnerPackage::list_packages( $component )
- );
+ # Needs to be done as soon as the component is loaded, as loading a sub-component
+ # (next time round the loop) can cause us to get the wrong metaclass..
+ $class->_controller_init_base_classes($component);
+ }
- for my $key ( keys %modules ) {
- $class->components->{ $key } = $modules{ $key };
+ for my $component (@comps) {
+ $class->components->{ $component } = $class->setup_component($component);
+ for my $component ($class->expand_component_module( $component, $config )) {
+ next if $comps{$component};
+ $class->_controller_init_base_classes($component); # Also cover inner packages
+ $class->components->{ $component } = $class->setup_component($component);
}
}
}
+=head2 $c->locate_components( $setup_component_config )
+
+This method is meant to provide a list of component modules that should be
+setup for the application. By default, it will use L<Module::Pluggable>.
+
+Specify a C<setup_components> config option to pass additional options directly
+to L<Module::Pluggable>. To add additional search paths, specify a key named
+C<search_extra> as an array reference. Items in the array beginning with C<::>
+will have the application class name prepended to them.
+
+=cut
+
+sub locate_components {
+ my $class = shift;
+ my $config = shift;
+
+ my @paths = qw( ::Controller ::C ::Model ::M ::View ::V );
+ my $extra = delete $config->{ search_extra } || [];
+
+ push @paths, @$extra;
+
+ my $locator = Module::Pluggable::Object->new(
+ search_path => [ map { s/^(?=::)/$class/; $_; } @paths ],
+ %$config
+ );
+
+ my @comps = $locator->plugins;
+
+ return @comps;
+}
+
+=head2 $c->expand_component_module( $component, $setup_component_config )
+
+Components found by C<locate_components> will be passed to this method, which
+is expected to return a list of component (package) names to be set up.
+
+=cut
+
+sub expand_component_module {
+ my ($class, $module) = @_;
+ return Devel::InnerPackage::list_packages( $module );
+}
+
=head2 $c->setup_component
=cut
+# FIXME - Ugly, ugly hack to ensure the we force initialize non-moose base classes
+# nearest to Catalyst::Controller first, no matter what order stuff happens
+# to be loaded. There are TODO tests in Moose for this, see
+# f2391d17574eff81d911b97be15ea51080500003
sub _controller_init_base_classes {
my ($app_class, $component) = @_;
+ return unless $component->isa('Catalyst::Controller');
foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) {
Moose::Meta::Class->initialize( $class )
unless find_meta($class);
@@ -2197,16 +2251,12 @@
return $component;
}
- # FIXME - Ugly, ugly hack to ensure the we force initialize non-moose base classes
- # nearest to Catalyst::Controller first, no matter what order stuff happens
- # to be loaded. There are TODO tests in Moose for this, see
- # f2391d17574eff81d911b97be15ea51080500003
- if ($component->isa('Catalyst::Controller')) {
- $class->_controller_init_base_classes($component);
- }
-
my $suffix = Catalyst::Utils::class2classsuffix( $component );
my $config = $class->config->{ $suffix } || {};
+ # Stash catalyst_component_name in the config here, so that custom COMPONENT
+ # methods also pass it. local to avoid pointlessly shitting in config
+ # for the debug screen, as $component is already the key name.
+ local $config->{catalyst_component_name} = $component;
my $instance = eval { $component->COMPONENT( $class, $config ); };
@@ -2510,7 +2560,7 @@
$class->_plugins( {} ) unless $class->_plugins;
$plugins ||= [];
- my @plugins = map { s/\A\+// ? $_ : "Catalyst::Plugin::$_" } @$plugins;
+ my @plugins = Catalyst::Utils::resolve_namespace($class . '::Plugin', 'Catalyst::Plugin', @$plugins);
for my $plugin ( reverse @plugins ) {
Class::MOP::load_class($plugin);
@@ -2587,7 +2637,7 @@
C<_ACTION>, and C<_END>. These are by default not shown in the private
action table, but you can make them visible with a config parameter.
- MyApp->config->{show_internal_actions} = 1;
+ MyApp->config(show_internal_actions => 1);
=head1 CASE SENSITIVITY
@@ -2595,7 +2645,7 @@
mapped to C</foo/bar>. You can activate case sensitivity with a config
parameter.
- MyApp->config->{case_sensitive} = 1;
+ MyApp->config(case_sensitive => 1);
This causes C<MyApp::C::Foo::Bar> to map to C</Foo/Bar>.
@@ -2605,7 +2655,7 @@
but if you want to handle input yourself, you can enable on-demand
parsing with a config parameter.
- MyApp->config->{parse_on_demand} = 1;
+ MyApp->config(parse_on_demand => 1);
=head1 PROXY SUPPORT
@@ -2626,6 +2676,18 @@
The host value for $c->req->base and $c->req->uri is set to the real
host, as read from the HTTP X-Forwarded-Host header.
+Additionally, you may be running your backend application on an insecure
+connection (port 80) while your frontend proxy is running under SSL. If there
+is a discrepancy in the ports, use the HTTP header C<X-Forwarded-Port> to
+tell Catalyst what port the frontend listens on. This will allow all URIs to
+be created properly.
+
+In the case of passing in:
+
+ X-Forwarded-Port: 443
+
+All calls to C<uri_for> will result in an https link, as is expected.
+
Obviously, your web server must support these headers for this to work.
In a more complex server farm environment where you may have your
@@ -2633,11 +2695,11 @@
configuration option to tell Catalyst to read the proxied data from the
headers.
- MyApp->config->{using_frontend_proxy} = 1;
+ MyApp->config(using_frontend_proxy => 1);
If you do not wish to use the proxy support at all, you may set:
- MyApp->config->{ignore_frontend_proxy} = 1;
+ MyApp->config(ignore_frontend_proxy => 1);
=head1 THREAD SAFETY
@@ -2674,7 +2736,7 @@
=head2 L<Catalyst::Manual> - The Catalyst Manual
-=head2 L<Catalyst::Component>, L<Catalyst::Base> - Base classes for components
+=head2 L<Catalyst::Component>, L<Catalyst::Controller> - Base classes for components
=head2 L<Catalyst::Engine> - Core engine
@@ -2698,7 +2760,7 @@
Andrew Bramble
-Andrew Ford
+Andrew Ford E<lt>A.Ford at ford-mason.co.ukE<gt>
Andrew Ruthven
@@ -2714,6 +2776,14 @@
chicks: Christopher Hicks
+Chisel Wright C<pause at herlpacker.co.uk>
+
+Danijel Milicevic C<me at danijel.de>
+
+David Kamholz E<lt>dkamholz at cpan.orgE<gt>
+
+David Naughton, C<naughton at umn.edu>
+
David E. Wheeler
dhoss: Devin Austin <dhoss at cpan.org>
@@ -2728,16 +2798,24 @@
fireartist: Carl Franks <cfranks at cpan.org>
+frew: Arthur Axel "fREW" Schmidt <frioux at gmail.com>
+
gabb: Danijel Milicevic
Gary Ashton Jones
+Gavin Henry C<ghenry at perl.me.uk>
+
Geoff Richards
+hobbs: Andrew Rodland <andrew at cleverdomain.org>
+
ilmari: Dagfinn Ilmari Mannsåker <ilmari at ilmari.org>
jcamacho: Juan Camacho
+jester: Jesse Sheidlower C<jester at panix.com>
+
jhannah: Jay Hannah <jay at jays.net>
Jody Belka
@@ -2746,6 +2824,12 @@
jon: Jon Schutz <jjschutz at cpan.org>
+Jonathan Rockway C<< <jrockway at cpan.org> >>
+
+Kieren Diment C<kd at totaldatasolution.com>
+
+konobi: Scott McWhirter <konobi at cpan.org>
+
marcus: Marcus Ramberg <mramberg at cpan.org>
miyagawa: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
@@ -2774,16 +2858,22 @@
random: Roland Lammel <lammel at cpan.org>
+Robert Sedlacek C<< <rs at 474.at> >>
+
sky: Arthur Bergman
-the_jester: Jesse Sheidlower
-
t0m: Tomas Doran <bobtfish at bobtfish.net>
Ulf Edvinsson
+Viljo Marrandi C<vilts at yahoo.com>
+
+Will Hawes C<info at whawes.co.uk>
+
willert: Sebastian Willert <willert at cpan.org>
+Yuval Kogman, C<nothingmuch at woobling.org>
+
=head1 LICENSE
This library is free software. You can redistribute it and/or modify it under
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_action.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_action.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_action.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -10,7 +10,7 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 28 * $iters;
+use Test::More tests => 42 * $iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
@@ -107,4 +107,44 @@
);
}
+ {
+ ok( my $response = request('http://localhost/action_action_five'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action_action_five', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Action',
+ 'Test Class'
+ );
+ is( $response->header('X-Action'), 'works' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
+
+ {
+ ok( my $response = request('http://localhost/action_action_six'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action_action_six', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Action',
+ 'Test Class'
+ );
+ is( $response->header('X-TestAppActionTestMyAction'), 'MyAction works' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
+
}
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_index_or_default.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_index_or_default.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_index_or_default.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,43 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
+
+use Test::More;
+use Catalyst::Test 'TestAppIndexDefault';
+
+plan 'skip_all' if ( $ENV{CATALYST_SERVER} );
+
+plan tests => 6*$iters;
+
+if ( $ENV{CAT_BENCHMARK} ) {
+ require Benchmark;
+ Benchmark::timethis( $iters, \&run_tests );
+}
+else {
+ for ( 1 .. $iters ) {
+ run_tests();
+ }
+}
+
+sub run_tests {
+ is(get('/indexchained'), 'index_chained', ':Chained overrides index');
+ is(get('/indexprivate'), 'index_private', 'index : Private still works');
+
+# test :Path overriding default
+ is(get('/one_arg'), 'path_one_arg', ':Path overrides default');
+ is(get('/one_arg/foo/bar'), 'default', 'default still works');
+
+# now the same thing with a namespace, and a trailing / on the :Path
+ is(get('/default/one_arg'), 'default_path_one_arg',
+ ':Path overrides default');
+ is(get('/default/one_arg/foo/bar'), 'default_default',
+ 'default still works');
+}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -10,7 +10,7 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 36*$iters;
+use Test::More tests => 42*$iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
@@ -142,4 +142,22 @@
'Content is a serialized Catalyst::Request'
);
}
+
+ {
+ ok( my $response = request('http://localhost/action/path/six'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/path/six', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Path',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path_matchsingle.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path_matchsingle.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_path_matchsingle.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -10,9 +10,13 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 3*$iters;
+use Test::More;
use Catalyst::Test 'TestAppMatchSingleArg';
+plan 'skip_all' if ( $ENV{CATALYST_SERVER} );
+
+plan tests => 3*$iters;
+
if ( $ENV{CAT_BENCHMARK} ) {
require Benchmark;
Benchmark::timethis( $iters, \&run_tests );
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_regexp.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_regexp.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_regexp.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -131,8 +131,10 @@
'TestApp::Controller::Action::Regexp',
'Test Class'
);
+ my $location = $response->header('location');
+ $location =~ s/localhost(:\d+)?/localhost/;
is(
- $response->header('location'),
+ $location,
$url,
'Redirect URI is the same as the request URI'
);
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_streaming.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_streaming.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_action_streaming.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -10,7 +10,7 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 10*$iters;
+use Test::More tests => 15*$iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
@@ -69,4 +69,14 @@
is( $response->content_length, -s $file, 'Response Content-Length' );
is( $response->content, $buffer, 'Content is read from filehandle' );
}
+
+ {
+ my $size = 128 * 1024; # more than one read with the default chunksize
+
+ ok( my $response = request('http://localhost/action/streaming/body_large'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content_length, $size, 'Response Content-Length' );
+ is( $response->content, "\0" x $size, 'Content is read from filehandle' );
+ }
}
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_anon.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_anon.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_anon.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,24 @@
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+use Test::More tests => 6;
+use Catalyst::Test 'TestApp';
+
+{
+ my $response = request('http://localhost/anon/test');
+ ok($response->is_success);
+ is($response->header('X-Component-Name-Action'),
+ 'TestApp::Controller::Anon', 'Action can see correct catalyst_component_name');
+ isnt($response->header('X-Component-Instance-Name-Action'),
+ 'TestApp::Controller::Anon', 'ref($controller) ne catalyst_component_name');
+ is($response->header('X-Component-Name-Controller'),
+ 'TestApp::Controller::Anon', 'Controller can see correct catalyst_component_name');
+ is($response->header('X-Class-In-Action'),
+ 'TestApp::Controller::Anon', '$action->class is catalyst_component_name');
+ is($response->header('X-Anon-Trait-Applied'),
+ '1', 'Anon controller class has trait applied correctly');
+}
+
Copied: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_attributes.t (from rev 10642, Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_atttributes.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_attributes.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_attributes.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,19 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+use Test::More tests => 4;
+use Catalyst::Test 'TestApp';
+
+ok( my $response = request('http://localhost/attributes/view'),
+ 'get /attributes/view' );
+ok( !$response->is_success, 'Response Unsuccessful' );
+
+ok( $response = request('http://localhost/attributes/foo'),
+ "get /attributes/foo" );
+
+ok( $response->is_success, "Response OK" );
Deleted: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_atttributes.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_atttributes.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_controller_atttributes.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,19 +0,0 @@
-#!perl
-
-use strict;
-use warnings;
-
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-
-use Test::More tests => 4;
-use Catalyst::Test 'TestApp';
-
-ok( my $response = request('http://localhost/attributes/view'),
- 'get /attributes/view' );
-ok( !$response->is_success, 'Response Unsuccessful' );
-
-ok( $response = request('http://localhost/attributes/foo'),
- "get /attributes/foo" );
-
-ok( $response->is_success, "Response OK" );
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_view_single.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_view_single.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_component_view_single.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -10,9 +10,13 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 3*$iters;
+use Test::More;
use Catalyst::Test 'TestAppOneView';
+plan 'skip_all' if ( $ENV{CATALYST_SERVER} );
+
+plan tests => 3*$iters;
+
if ( $ENV{CAT_BENCHMARK} ) {
require Benchmark;
Benchmark::timethis( $iters, \&run_tests );
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_escaped_path.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_escaped_path.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_escaped_path.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,73 @@
+#!/usr/bin/evn perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+use Test::More tests => 6;
+use TestApp;
+use HTTP::Request::AsCGI;
+
+=pod
+
+This test exposes a problem in the handling of PATH_INFO in C::Engine::CGI (and
+other engines) where Catalyst does not un-escape the request correctly.
+If a request is URL-encoded then Catalyst fails to decode the request
+and thus will try and match actions using the URL-encoded value.
+
+Can NOT use Catalyst::Test as it uses HTTP::Request::AsCGI which does
+correctly unescape the path (by calling $uri = $uri->canonical).
+
+This will fix the problem for the CGI engine, but is probably the
+wrong place. And also does not fix $uri->base, either.
+
+Plus, the same issue is in Engine::Apache* and other engines.
+
+Index: lib/Catalyst/Engine/CGI.pm
+===================================================================
+--- lib/Catalyst/Engine/CGI.pm (revision 7821)
++++ lib/Catalyst/Engine/CGI.pm (working copy)
+@@ -157,6 +157,8 @@
+ my $query = $ENV{QUERY_STRING} ? '?' . $ENV{QUERY_STRING} : '';
+ my $uri = $scheme . '://' . $host . '/' . $path . $query;
+
++ $uri = URI->new( $uri )->canonical;
++
+ $c->request->uri( bless \$uri, $uri_class );
+
+ # set the base URI
+
+=cut
+
+# test that un-escaped can be feteched.
+{
+
+ my $request = Catalyst::Utils::request( 'http://localhost/args/params/one/two' );
+ my $cgi = HTTP::Request::AsCGI->new( $request, %ENV )->setup;
+
+ TestApp->handle_request( env => \%ENV );
+
+ ok( my $response = $cgi->restore->response );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'onetwo' );
+}
+
+# test that request with URL-escaped code works.
+TODO: {
+ local $TODO = 'Actions should match when path parts are url encoded';
+ my $request = Catalyst::Utils::request( 'http://localhost/args/param%73/one/two' );
+ my $cgi = HTTP::Request::AsCGI->new( $request, %ENV )->setup;
+
+ # Reset PATH_INFO because AsCGI calls $uri = $uri->canonical which
+ # will unencode the path and hide the problem from the test.
+ $ENV{PATH_INFO} = '/args/param%73/one/two';
+
+
+ TestApp->handle_request( env => \%ENV );
+
+ ok( my $response = $cgi->restore->response );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'onetwo' );
+}
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_headers.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_headers.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_headers.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -6,7 +6,7 @@
use FindBin;
use lib "$FindBin::Bin/../lib";
-use Test::More tests => 17;
+use Test::More tests => 18;
use Catalyst::Test 'TestApp';
use Catalyst::Request;
@@ -22,6 +22,7 @@
'X-Multiple' => [ 1 .. 5 ],
'X-Forwarded-Host' => 'frontend.server.com',
'X-Forwarded-For' => '192.168.1.1, 1.2.3.4',
+ 'X-Forwarded-Port' => 443
);
ok( my $response = request($request), 'Request' );
@@ -30,6 +31,7 @@
like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
isa_ok( $creq, 'Catalyst::Request' );
+ ok( $creq->secure, 'Forwarded port sets securet' );
isa_ok( $creq->headers, 'HTTP::Headers', 'Catalyst::Request->headers' );
is( $creq->header('X-Whats-Cool'), $request->header('X-Whats-Cool'), 'Catalyst::Request->header X-Whats-Cool' );
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_remote_user.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_remote_user.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/live_engine_request_remote_user.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -37,6 +37,11 @@
}
isa_ok( $creq, 'Catalyst::Request' );
-
- is( $creq->remote_user, 'dwc', '$c->req->remote_user ok' );
+ SKIP:
+ {
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 1;
+ }
+ is( $creq->remote_user, 'dwc', '$c->req->remote_user ok' );
+ }
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_uri_for_action.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_uri_for_action.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate/unit_core_uri_for_action.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -8,7 +8,7 @@
use Test::More;
-plan tests => 29;
+plan tests => 30;
use_ok('TestApp');
@@ -97,6 +97,10 @@
namespace => 'yada',
} );
+is($context->uri_for($context->controller('Action')),
+ "http://127.0.0.1/foo/yada/action/",
+ "uri_for a controller");
+
is($context->uri_for($path_action),
"http://127.0.0.1/foo/action/relative/relative",
"uri_for correct for path action");
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/aggregate.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -6,7 +6,12 @@
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::Aggregate;
+BEGIN {
+ unless (eval { require Test::Aggregate; Test::Aggregate->VERSION('0.35_05'); 1 }) {
+ require Test::More;
+ Test::More::plan(skip_all => 'Test::Aggregate 0.35_05 required for test aggregation');
+ }
+}
my $tests = Test::Aggregate->new({
dirs => 't/aggregate',
Copied: Catalyst-Runtime/5.80/branches/better_scripts/t/author/optional_http-server.t (from rev 10642, Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server.t)
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/author/optional_http-server.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/author/optional_http-server.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,96 @@
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+use File::Path;
+use FindBin;
+use IPC::Open3;
+use IO::Socket;
+
+use Catalyst::Devel 1.0;
+use File::Copy::Recursive;
+
+# Run a single test by providing it as the first arg
+my $single_test = shift;
+
+my $tmpdir = "$FindBin::Bin/../../t/tmp";
+
+# clean up
+rmtree $tmpdir if -d $tmpdir;
+
+# create a TestApp and copy the test libs into it
+mkdir $tmpdir;
+chdir $tmpdir;
+system( $^X, "-I$FindBin::Bin/../../lib", "$FindBin::Bin/../../script/catalyst.pl", 'TestApp' );
+chdir "$FindBin::Bin/..";
+File::Copy::Recursive::dircopy( '../t/lib', '../t/tmp/TestApp/lib' ) or die;
+
+# remove TestApp's tests
+rmtree '../t/tmp/TestApp/t' or die;
+
+# spawn the standalone HTTP server
+my $port = 30000 + int rand(1 + 10000);
+my @cmd = ($^X, "-I$FindBin::Bin/../../lib",
+ "$FindBin::Bin/../../t/tmp/TestApp/script/testapp_server.pl", '-port', $port );
+my $pid = open3( undef, my $server, undef, @cmd)
+ or die "Unable to spawn standalone HTTP server: $!";
+
+# wait for it to start
+print "Waiting for server to start...\n";
+my $timeout = 30;
+my $count = 0;
+while ( check_port( 'localhost', $port ) != 1 ) {
+ sleep 1;
+ die("Server did not start within $timeout seconds: " . join(' ', @cmd))
+ if $count++ > $timeout;
+}
+
+# run the testsuite against the HTTP server
+$ENV{CATALYST_SERVER} = "http://localhost:$port";
+
+my $return;
+if ( $single_test ) {
+ $return = system( "$^X -I../lib/ $single_test" );
+}
+else {
+ $return = prove( '-r', '-I../lib/', glob('../t/aggregate/live_*.t') );
+}
+
+# shut it down
+kill 'INT', $pid;
+close $server;
+
+# clean up
+rmtree "$FindBin::Bin/../../t/tmp" if -d "$FindBin::Bin/../../t/tmp";
+
+is( $return, 0, 'live tests' );
+
+sub check_port {
+ my ( $host, $port ) = @_;
+
+ my $remote = IO::Socket::INET->new(
+ Proto => "tcp",
+ PeerAddr => $host,
+ PeerPort => $port
+ );
+ if ($remote) {
+ close $remote;
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+sub prove {
+ if (!(my $pid = fork)) {
+ require App::Prove;
+ my $prove = App::Prove->new;
+ $prove->process_args(@_);
+ exit( $prove->run ? 0 : 1 );
+ } else {
+ waitpid $pid, 0;
+ return $?;
+ }
+}
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/c3_appclass_bug.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/c3_appclass_bug.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/c3_appclass_bug.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,30 @@
+use strict;
+use Test::More tests => 1;
+
+{
+ package TestPlugin;
+ use strict;
+
+ sub setup {
+ shift->maybe::next::method(@_);
+ }
+}
+{
+ package TestAppC3ErrorUseMoose;
+ use Moose;
+
+ use Catalyst::Runtime 5.80;
+
+ use base qw/Catalyst/;
+ use Catalyst qw/
+ +TestPlugin
+ /;
+}
+
+use Test::Exception;
+lives_ok {
+ TestAppC3ErrorUseMoose->setup();
+} 'No C3 error';
+
+1;
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/caf_backcompat.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/caf_backcompat.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/caf_backcompat.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -12,7 +12,6 @@
Catalyst::Component
Catalyst::Dispatcher
Catalyst::DispatchType
- Catalyst::Engine::HTTP::Restarter::Watcher
Catalyst::Engine
Catalyst::Log
Catalyst::Request::Upload
Deleted: Catalyst-Runtime/5.80/branches/better_scripts/t/cdi_backcompat_plugin_accessor_override.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/cdi_backcompat_plugin_accessor_override.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/cdi_backcompat_plugin_accessor_override.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,39 +0,0 @@
-use strict;
-use warnings;
-use lib 't/lib';
-
-use Test::More tests => 2;
-use Test::Exception;
-
-# Force a stack trace.
-use Carp;
-$SIG{__DIE__} = \&Carp::confess;
-
-{
- package CDICompatTestApp;
- use Catalyst qw/
- +CDICompatTestPlugin
- /;
- # Calling ->config here (before we call setup). With CDI/Cat 5.70 this
- # causes *CDICompatTestApp::_config to have a class data accessor created.
-
- # If this doesn't happen, then later when we've added CDICompatTestPlugin
- # to @ISA, we fail in the overridden ->setup method when we call ->config
- # again, as we get the CAF accessor from CDICompatTestPlugin, not the one
- # created in this package as a side-effect of this call. :-(
- __PACKAGE__->config;
-}
-
-SKIP: {
- skip 'Not trying to replicate the nasty CDI hackness', 2;
- lives_ok {
- CDICompatTestApp->setup;
- } 'Setup app with plugins which says use base qw/Class::Accessor::Fast/';
-
- # And the plugin's setup_finished method should have been run, as accessors
- # are not created in MyApp until the data is written to.
- {
- no warnings 'once';
- is $CDICompatTestPlugin::Data::HAS_RUN_SETUP_FINISHED, 1, 'Plugin setup_finish run';
- }
-}
\ No newline at end of file
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/custom_exception_class_simple.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/custom_exception_class_simple.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/custom_exception_class_simple.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,18 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+use Test::More tests => 1;
+use Test::Exception;
+
+TODO: {
+ local $TODO = 'Does not work yet';
+
+lives_ok {
+ require TestAppClassExceptionSimpleTest;
+} 'Can load application';
+
+}
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/deprecated.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/deprecated.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/deprecated.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -16,6 +16,8 @@
BEGIN {
my $logger = Class::MOP::Class->create_anon_class(
methods => {
+ debug => sub {0},
+ info => sub {0},
warn => sub {
if ($_[1] =~ /switch your class names/) {
$mvc_warnings++;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Action/TestMyAction.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Action/TestMyAction.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Action/TestMyAction.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -9,6 +9,9 @@
my $self = shift;
my ( $controller, $c, $test ) = @_;
$c->res->header( 'X-TestAppActionTestMyAction', 'MyAction works' );
+ $c->res->header( 'X-Component-Name-Action', $controller->catalyst_component_name);
+ $c->res->header( 'X-Component-Instance-Name-Action', ref($controller));
+ $c->res->header( 'X-Class-In-Action', $self->class);
$self->next::method(@_);
}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Action.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Action.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Action.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -3,6 +3,8 @@
use strict;
use base 'TestApp::Controller::Action';
+__PACKAGE__->config( actions => { action_action_five => { ActionClass => '+Catalyst::Action::TestBefore' } } );
+
sub action_action_one : Global : ActionClass('TestBefore') {
my ( $self, $c ) = @_;
$c->res->header( 'X-Action', $c->stash->{test} );
@@ -25,4 +27,15 @@
$c->forward('TestApp::View::Dump::Request');
}
+sub action_action_five : Global {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Action', $c->stash->{test} );
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_six : Global : ActionClass('~TestMyAction') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
1;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Inheritance.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Inheritance.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Inheritance.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -70,5 +70,17 @@
my ( $self, $c ) = @_;
}
+package TestApp::Controller::Action::Inheritance::B;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+# check configuration for an inherited action
+__PACKAGE__->config(
+ action => {
+ begin => {}
+ }
+);
+
1;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Path.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Path.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Path.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -7,6 +7,7 @@
actions => {
'one' => { 'Path' => [ 'a path with spaces' ] },
'two' => { 'Path' => "åäö" },
+ 'six' => { 'Local' => undef },
},
);
@@ -35,4 +36,9 @@
$c->forward('TestApp::View::Dump::Request');
}
+sub six {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
1;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Streaming.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Streaming.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Action/Streaming.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -16,7 +16,7 @@
sub body : Local {
my ( $self, $c ) = @_;
-
+
my $file = "$FindBin::Bin/../lib/TestApp/Controller/Action/Streaming.pm";
my $fh = IO::File->new( $file, 'r' );
if ( defined $fh ) {
@@ -27,4 +27,16 @@
}
}
+sub body_large : Local {
+ my ($self, $c) = @_;
+
+ # more than one write with the default chunksize
+ my $size = 128 * 1024;
+
+ my $data = "\0" x $size;
+ open my $fh, '<', \$data;
+ $c->res->content_length($size);
+ $c->res->body($fh);
+}
+
1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Anon.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Anon.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/Anon.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,40 @@
+package Anon::Trait;
+use Moose::Role -traits => 'MethodAttributes'; # Needed for role composition to work correctly with anon classes.
+
+after test => sub {
+ my ($self, $c) = @_;
+ $c->res->header('X-Anon-Trait-Applied', 1);
+};
+
+no Moose::Role;
+
+package TestApp::Controller::Anon;
+use Moose;
+use Moose::Util qw/find_meta/;
+use namespace::clean -except => 'meta';
+BEGIN { extends 'Catalyst::Controller' };
+
+sub COMPONENT { # Don't do this yourself, use CatalystX::Component::Traits!
+ my ($class, $app, $args) = @_;
+
+ my $meta = $class->meta->create_anon_class(
+ superclasses => [ $class->meta->name ],
+ roles => ['Anon::Trait'],
+ cache => 1,
+ );
+ # Special move as the methodattributes trait has changed our metaclass..
+ $meta = find_meta($meta->name);
+
+ $meta->add_method('meta' => sub { $meta });
+ $class = $meta->name;
+ $class->new($app, $args);
+}
+
+sub test : Local ActionClass('+TestApp::Action::TestMyAction') {
+ my ($self, $c) = @_;
+ $c->res->header('X-Component-Name-Controller', $self->catalyst_component_name);
+ $c->res->body('It works');
+}
+
+__PACKAGE__->meta->make_immutable;
+
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/ContextClosure.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/ContextClosure.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp/Controller/ContextClosure.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,29 @@
+package TestApp::Controller::ContextClosure;
+
+use Moose;
+
+BEGIN {
+ extends 'Catalyst::Controller';
+ with 'Catalyst::Component::ContextClosure';
+}
+
+sub normal_closure : Local {
+ my ($self, $ctx) = @_;
+ $ctx->stash(closure => sub {
+ $ctx->response->body('from normal closure');
+ });
+ $ctx->response->body('stashed normal closure');
+}
+
+sub context_closure : Local {
+ my ($self, $ctx) = @_;
+ $ctx->stash(closure => $self->make_context_closure(sub {
+ my ($ctx) = @_;
+ $ctx->response->body('from context closure');
+ }, $ctx));
+ $ctx->response->body('stashed context closure');
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestApp.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -13,10 +13,32 @@
/;
use Catalyst::Utils;
+use Moose;
+use namespace::autoclean;
+
our $VERSION = '0.01';
TestApp->config( name => 'TestApp', root => '/some/dir' );
+if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
+ with 'CatalystX::LeakChecker';
+
+ has leaks => (
+ is => 'ro',
+ default => sub { [] },
+ );
+}
+
+sub found_leaks {
+ my ($ctx, @leaks) = @_;
+ push @{ $ctx->leaks }, @leaks;
+}
+
+sub count_leaks {
+ my ($ctx) = @_;
+ return scalar @{ $ctx->leaks };
+}
+
TestApp->setup;
sub index : Private {
@@ -55,7 +77,7 @@
@executed
);
}
-
+ no warnings 'recursion';
return $c->SUPER::execute(@_);
}
@@ -85,6 +107,7 @@
sub recursion_test : Local {
my ( $self, $c ) = @_;
+ no warnings 'recursion';
$c->forward( 'recursion_test' );
}
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppClassExceptionSimpleTest.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppClassExceptionSimpleTest.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppClassExceptionSimpleTest.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,19 @@
+package TestAppClassExceptionSimpleTest::Exception;
+use strict;
+use warnings;
+
+sub throw {}
+
+#########
+
+package TestAppClassExceptionSimpleTest;
+use strict;
+use warnings;
+
+BEGIN { $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; }
+
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Default.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Default.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Default.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,15 @@
+package TestAppIndexDefault::Controller::Default;
+
+use base 'Catalyst::Controller';
+
+sub default : Private {
+ my ($self, $c) = @_;
+ $c->res->body('default_default');
+}
+
+sub path_one_arg : Path('/default/') Args(1) {
+ my ($self, $c) = @_;
+ $c->res->body('default_path_one_arg');
+}
+
+1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexChained.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexChained.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexChained.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,12 @@
+package TestAppIndexDefault::Controller::IndexChained;
+
+use base 'Catalyst::Controller';
+
+sub index : Chained('/') PathPart('indexchained') CaptureArgs(0) {}
+
+sub index_endpoint : Chained('index') PathPart('') Args(0) {
+ my ($self, $c) = @_;
+ $c->res->body('index_chained');
+}
+
+1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,10 @@
+package TestAppIndexDefault::Controller::IndexPrivate;
+
+use base 'Catalyst::Controller';
+
+sub index : Private {
+ my ($self, $c) = @_;
+ $c->res->body('index_private');
+}
+
+1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Root.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault/Controller/Root.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,17 @@
+package TestAppIndexDefault::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub default : Private {
+ my ($self, $c) = @_;
+ $c->res->body('default');
+}
+
+sub path_one_arg : Path('/') Args(1) {
+ my ($self, $c) = @_;
+ $c->res->body('path_one_arg');
+}
+
+1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppIndexDefault.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,8 @@
+package TestAppIndexDefault;
+use strict;
+use warnings;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/Controller/Foo.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/Controller/Foo.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/Controller/Foo.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,5 @@
+package TestAppNonMooseController::Controller::Foo;
+use base qw/TestAppNonMooseController::ControllerBase/;
+
+1;
+
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/ControllerBase.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/ControllerBase.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController/ControllerBase.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,5 @@
+package TestAppNonMooseController::ControllerBase;
+use base qw/Catalyst::Controller/;
+
+1;
+
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestAppNonMooseController.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,8 @@
+package TestAppNonMooseController;
+use base qw/Catalyst/;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestPluginWithConstructor.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestPluginWithConstructor.pm 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/lib/TestPluginWithConstructor.pm 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,11 +1,17 @@
# See t/plugin_new_method_backcompat.t
-package TestPluginWithConstructor;
+package Class::Accessor::Fast;
use strict;
use warnings;
+
sub new {
my $class = shift;
return bless $_[0], $class;
}
+package TestPluginWithConstructor;
+use strict;
+use warnings;
+use base qw/Class::Accessor::Fast/;
+
1;
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/live_component_controller_context_closure.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/live_component_controller_context_closure.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/live_component_controller_context_closure.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+ unless (eval 'use CatalystX::LeakChecker 0.03; 1') {
+ plan skip_all => 'CatalystX::LeakChecker 0.03 required for this test';
+ }
+
+ plan tests => 4;
+}
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Catalyst::Test 'TestApp';
+
+{
+ my ($resp, $ctx) = ctx_request('/contextclosure/normal_closure');
+ ok($resp->is_success);
+ is($ctx->count_leaks, 1);
+}
+
+{
+ my ($resp, $ctx) = ctx_request('/contextclosure/context_closure');
+ ok($resp->is_success);
+ is($ctx->count_leaks, 0);
+}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server-restart.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server-restart.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server-restart.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -45,10 +45,11 @@
my $port = 30000 + int rand( 1 + 10000 );
my( $server, $pid );
-$pid = open3( undef, $server, undef,
- $^X, "-I$FindBin::Bin/../lib",
+my @cmd = ($^X, "-I$FindBin::Bin/../lib", "-I$FindBin::Bin/lib",
"$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl", '-port',
- $port, '-restart' )
+ $port, '-restart');
+
+$pid = open3( undef, $server, undef, @cmd )
or die "Unable to spawn standalone HTTP server: $!";
# switch to non-blocking reads so we can fail
@@ -67,11 +68,9 @@
"$FindBin::Bin/../t/tmp/TestApp/lib/TestApp.pm",
"$FindBin::Bin/../t/tmp/TestApp/lib/TestApp/Controller/Action/Begin.pm",
"$FindBin::Bin/../t/tmp/TestApp/lib/TestApp/Controller/Immutable.pm",
+ "$FindBin::Bin/../t/tmp/TestApp/lib/TestApp/Controller/Immutable/HardToReload.pm",
);
-push(@files, "$FindBin::Bin/../t/tmp/TestApp/lib/TestApp/Controller/Immutable/HardToReload.pm")
- if Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION();
-
# change some files and make sure the server restarts itself
NON_ERROR_RESTART:
for ( 1 .. 20 ) {
@@ -84,7 +83,6 @@
# give the server time to notice the change and restart
my $count = 0;
my $line;
-
while ( ( $line || '' ) !~ /can connect/ ) {
# wait for restart message
$line = $server->getline;
Deleted: Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/optional_http-server.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,98 +0,0 @@
-use strict;
-use warnings;
-
-use Test::More;
-BEGIN {
- plan skip_all => 'set TEST_HTTP to enable this test' unless $ENV{TEST_HTTP};
-}
-
-use File::Path;
-use FindBin;
-use IPC::Open3;
-use IO::Socket;
-
-eval "use Catalyst::Devel 1.0";
-plan skip_all => 'Catalyst::Devel required' if $@;
-eval "use File::Copy::Recursive";
-plan skip_all => 'File::Copy::Recursive required' if $@;
-plan tests => 1;
-
-# Run a single test by providing it as the first arg
-my $single_test = shift;
-
-my $tmpdir = "$FindBin::Bin/../t/tmp";
-
-# clean up
-rmtree $tmpdir if -d $tmpdir;
-
-# create a TestApp and copy the test libs into it
-mkdir $tmpdir;
-chdir $tmpdir;
-system( $^X, "-I$FindBin::Bin/../lib", "$FindBin::Bin/../script/catalyst.pl", 'TestApp' );
-chdir "$FindBin::Bin/..";
-File::Copy::Recursive::dircopy( 't/lib', 't/tmp/TestApp/lib' );
-
-# remove TestApp's tests
-rmtree 't/tmp/TestApp/t';
-
-# spawn the standalone HTTP server
-my $port = 30000 + int rand(1 + 10000);
-my $pid = open3( undef, my $server, undef,
- $^X, "-I$FindBin::Bin/../lib",
- "$FindBin::Bin/../t/tmp/TestApp/script/testapp_server.pl", '-port', $port )
- or die "Unable to spawn standalone HTTP server: $!";
-
-# wait for it to start
-print "Waiting for server to start...\n";
-while ( check_port( 'localhost', $port ) != 1 ) {
- sleep 1;
-}
-
-# run the testsuite against the HTTP server
-$ENV{CATALYST_SERVER} = "http://localhost:$port";
-
-my $return;
-if ( $single_test ) {
- $return = system( "$^X -Ilib/ $single_test" );
-}
-else {
- $return = prove( '-r', '-Ilib/', glob('t/aggregate/live_*.t') );
-}
-
-# shut it down
-kill 'INT', $pid;
-close $server;
-
-# clean up
-rmtree "$FindBin::Bin/../t/tmp" if -d "$FindBin::Bin/../t/tmp";
-
-is( $return, 0, 'live tests' );
-
-sub check_port {
- my ( $host, $port ) = @_;
-
- my $remote = IO::Socket::INET->new(
- Proto => "tcp",
- PeerAddr => $host,
- PeerPort => $port
- );
- if ($remote) {
- close $remote;
- return 1;
- }
- else {
- return 0;
- }
-}
-
-sub prove {
- if (!(my $pid = fork)) {
- require App::Prove;
- my $prove = App::Prove->new;
- $prove->process_args(@_);
- exit( $prove->run ? 0 : 1 );
- } else {
- waitpid $pid, 0;
- return $?;
- }
-}
Added: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_action.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_action.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_action.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -0,0 +1,54 @@
+use Test::More tests => 6;
+use strict;
+use warnings;
+use Moose::Meta::Class;
+#use Moose::Meta::Attribute;
+use Catalyst::Request;
+
+use_ok('Catalyst::Action');
+
+my $action_1 = Catalyst::Action->new(
+ name => 'foo',
+ code => sub { "DUMMY" },
+ reverse => 'bar/foo',
+ namespace => 'bar',
+ attributes => {
+ Args => [ 1 ],
+ attr2 => [ 2 ],
+ },
+);
+
+my $action_2 = Catalyst::Action->new(
+ name => 'foo',
+ code => sub { "DUMMY" },
+ reverse => 'bar/foo',
+ namespace => 'bar',
+ attributes => {
+ Args => [ 2 ],
+ attr2 => [ 2 ],
+ },
+);
+
+is("${action_1}", $action_1->reverse, 'overload string');
+is($action_1->(), 'DUMMY', 'overload code');
+
+my $anon_meta = Moose::Meta::Class->create_anon_class(
+ attributes => [
+ Moose::Meta::Attribute->new(
+ request => (
+ reader => 'request',
+ required => 1,
+ default => sub { Catalyst::Request->new(arguments => [qw/one two/]) },
+ ),
+ ),
+ ],
+ methods => { req => sub { shift->request(@_) } }
+);
+
+my $mock_c = $anon_meta->new_object();
+$mock_c->request;
+
+ok(!$action_1->match($mock_c), 'bad match fails');
+ok($action_2->match($mock_c), 'good match works');
+
+ok($action_2->compare( $action_1 ), 'compare works');
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_classdata.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_classdata.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_classdata.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -100,3 +100,7 @@
is(refaddr(ClassDataTest->_scalarref), refaddr($scalarref3));
is(refaddr(ClassDataTest->_coderef), refaddr($coderef3));
is(ClassDataTest->_scalar, $scalar3);
+
+my $i = bless {}, 'ClassDataTest';
+$i->_scalar('foo');
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_component_loading.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_component_loading.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_component_loading.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,7 +1,8 @@
# 2 initial tests, and 6 per component in the loop below
# (do not forget to update the number of components in test 3 as well)
# 5 extra tests for the loading options
-use Test::More tests => 2 + 6 * 24 + 5;
+# One test for components in inner packages
+use Test::More tests => 2 + 6 * 24 + 8 + 1;
use strict;
use warnings;
@@ -174,6 +175,9 @@
my \$self = shift->next::method(\@_);
no strict 'refs';
*{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; };
+ *${appclass}::Model::TopLevel::GENERATED::ACCEPT_CONTEXT = sub {
+ return bless {}, 'FooBarBazQuux';
+ };
\$self;
}
@@ -189,8 +193,10 @@
package ${appclass}::Model::TopLevel::Nested;
use base 'Catalyst::Model';
+my \$called=0;
no warnings 'redefine';
-sub COMPONENT { return shift->next::method(\@_); }
+sub COMPONENT { \$called++;return shift->next::method(\@_); }
+sub called { return \$called };
1;
EOF
@@ -198,5 +204,23 @@
eval "package $appclass; use Catalyst; __PACKAGE__->setup";
is($@, '', "Didn't load component twice");
+is($appclass->model('TopLevel::Nested')->called,1, 'COMPONENT called once');
+ok($appclass->model('TopLevel::Generated'), 'Have generated model');
+is(ref($appclass->model('TopLevel::Generated')), 'FooBarBazQuux',
+ 'ACCEPT_CONTEXT in generated inner package fired as expected');
+
+$appclass = "InnerComponent";
+
+{
+ package InnerComponent::Controller::Test;
+ use base 'Catalyst::Controller';
+}
+
+$INC{'InnerComponent/Controller/Test.pm'} = 1;
+
+eval "package $appclass; use Catalyst; __PACKAGE__->setup";
+
+isa_ok($appclass->controller('Test'), 'Catalyst::Controller');
+
rmtree($libdir);
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_plugin.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_plugin.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_plugin.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -21,6 +21,9 @@
use PluginTestApp;
my $logger = Class::MOP::Class->create_anon_class(
methods => {
+ error => sub {0},
+ debug => sub {0},
+ info => sub {0},
warn => sub {
if ($_[1] =~ /plugin method is deprecated/) {
$warnings++;
@@ -40,6 +43,8 @@
# for Catalyst 5.9
ok( get("/run_time_plugins"), "get ok" );
+local $ENV{CATALYST_DEBUG} = 0;
+
is( $warnings, 1, '1 warning' );
use_ok 'TestApp';
@@ -56,3 +61,4 @@
# Faux::Plugin is no longer reported
is_deeply [ TestApp->registered_plugins ], \@expected,
'registered_plugins() should only report the plugins for the current class';
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -26,12 +26,17 @@
return $name;
}
-local %ENV; # Don't allow env variables to mess us up.
+local %ENV = %ENV;
+# Remove all relevant env variables to avoid accidental fail
+foreach my $name (grep { /^(CATALYST|TESTAPP)/ } keys %ENV) {
+ delete $ENV{$name};
+}
+
{
- my $app = build_test_app_with_setup('MyTestDebug', '-Debug');
+ my $app = build_test_app_with_setup('TestAppMyTestDebug', '-Debug');
- ok my $c = MyTestDebug->new, 'Get debug app object';
+ ok my $c = $app->new, 'Get debug app object';
ok my $log = $c->log, 'Get log object';
isa_ok $log, 'Catalyst::Log', 'It should be a Catalyst::Log object';
ok $log->is_warn, 'Warnings should be enabled';
@@ -43,7 +48,7 @@
}
{
- my $app = build_test_app_with_setup('MyTestLogParam', '-Log=warn,error,fatal');
+ my $app = build_test_app_with_setup('TestAppMyTestLogParam', '-Log=warn,error,fatal');
ok my $c = $app->new, 'Get log app object';
ok my $log = $c->log, 'Get log object';
@@ -56,7 +61,7 @@
ok !$c->debug, 'Catalyst debugging is off';
}
{
- my $app = build_test_app_with_setup('MyTestNoParams');
+ my $app = build_test_app_with_setup('TestAppMyTestNoParams');
ok my $c = $app->new, 'Get log app object';
ok my $log = $c->log, 'Get log object';
@@ -72,12 +77,12 @@
methods => { map { $_ => sub { 0 } } qw/debug error fatal info warn/ },
);
{
- package MyTestAppWithOwnLogger;
+ package TestAppWithOwnLogger;
use base qw/Catalyst/;
__PACKAGE__->log($log_meta->new_object);
__PACKAGE__->setup('-Debug');
}
-ok my $c = MyTestAppWithOwnLogger->new, 'Get with own logger app object';
+ok my $c = TestAppWithOwnLogger->new, 'Get with own logger app object';
ok $c->debug, '$c->debug is true';
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_log.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_log.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_log.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -27,10 +27,15 @@
}
}
-local %ENV; # Ensure blank or someone, somewhere will fail..
+local %ENV = %ENV;
+# Remove all relevant env variables to avoid accidental fail
+foreach my $name (grep { /^(CATALYST|TESTAPP)/ } keys %ENV) {
+ delete $ENV{$name};
+}
+
{
- my $app = mock_app('TestLogAppParseLevels');
+ my $app = mock_app('TestAppParseLogLevels');
$app->setup_log('error,warn');
ok !$app->debug, 'Not in debug mode';
test_log_object($app->log,
@@ -42,8 +47,9 @@
);
}
{
- local %ENV = ( CATALYST_DEBUG => 1 );
- my $app = mock_app('TestLogAppDebugEnvSet');
+ local %ENV = %ENV;
+ $ENV{CATALYST_DEBUG} = 1;
+ my $app = mock_app('TestAppLogDebugEnvSet');
$app->setup_log('');
ok $app->debug, 'In debug mode';
test_log_object($app->log,
@@ -55,8 +61,9 @@
);
}
{
- local %ENV = ( CATALYST_DEBUG => 0 );
- my $app = mock_app('TestLogAppDebugEnvUnset');
+ local %ENV = %ENV;
+ $ENV{CATALYST_DEBUG} = 0;
+ my $app = mock_app('TestAppLogDebugEnvUnset');
$app->setup_log('warn');
ok !$app->debug, 'Not In debug mode';
test_log_object($app->log,
@@ -68,7 +75,7 @@
);
}
{
- my $app = mock_app('TestLogAppEmptyString');
+ my $app = mock_app('TestAppLogEmptyString');
$app->setup_log('');
ok !$app->debug, 'Not In debug mode';
# Note that by default, you get _all_ the log levels turned on
@@ -81,7 +88,7 @@
);
}
{
- my $app = mock_app('TestLogAppDebugOnly');
+ my $app = mock_app('TestAppLogDebugOnly');
$app->setup_log('debug');
ok $app->debug, 'In debug mode';
test_log_object($app->log,
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_stats.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_stats.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_setup_stats.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -22,40 +22,46 @@
sub mock_app {
my $name = shift;
%log_messages = (); # Flatten log messages.
- print "Setting up mock application: $name\n";
my $meta = Moose->init_meta( for_class => $name );
$meta->superclasses('Catalyst');
$meta->add_method('log', sub { $mock_log });
return $meta->name;
}
-local %ENV; # Ensure blank or someone, somewhere will fail..
+local %ENV = %ENV;
+# Remove all relevant env variables to avoid accidental fail
+foreach my $name (grep { /^(CATALYST|TESTAPP)/ } keys %ENV) {
+ delete $ENV{$name};
+}
+
{
- my $app = mock_app('TestNoStats');
+ my $app = mock_app('TestAppNoStats');
$app->setup_stats();
ok !$app->use_stats, 'stats off by default';
}
{
- my $app = mock_app('TestStats');
+ my $app = mock_app('TestAppStats');
$app->setup_stats(1);
ok $app->use_stats, 'stats on if you say >setup_stats(1)';
}
{
- my $app = mock_app('TestStatsDebugTurnsStatsOn');
+ my $app = mock_app('TestAppStatsDebugTurnsStatsOn');
$app->meta->add_method('debug' => sub { 1 });
$app->setup_stats();
ok $app->use_stats, 'debug on turns stats on';
}
{
- local %ENV = ( CATALYST_STATS => 1 );
- my $app = mock_app('TestStatsAppStatsEnvSet');
+ local %ENV = %ENV;
+ $ENV{CATALYST_STATS} = 1;
+ my $app = mock_app('TestAppStatsEnvSet');
$app->setup_stats();
ok $app->use_stats, 'ENV turns stats on';
}
{
- local %ENV = ( CATALYST_STATS => 0 );
- my $app = mock_app('TestStatsAppStatsEnvUnset');
+ local %ENV = %ENV;
+ $ENV{CATALYST_STATS} = 0;
+ my $app = mock_app('TestAppStatsEnvUnset');
$app->meta->add_method('debug' => sub { 1 });
$app->setup_stats(1);
ok !$app->use_stats, 'ENV turns stats off, even when debug on and ->setup_stats(1)';
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_for.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_for.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_for.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More tests => 19;
+use Test::More tests => 20;
use URI;
use_ok('Catalyst');
@@ -133,3 +133,13 @@
);
}
+# make sure caller's query parameter hash isn't messed up
+{
+ my $query_params_base = {test => "one two",
+ bar => ["foo baz", "bar"]};
+ my $query_params_test = {test => "one two",
+ bar => ["foo baz", "bar"]};
+ Catalyst::uri_for($context, '/bar/baz', $query_params_test);
+ is_deeply($query_params_base, $query_params_test,
+ "uri_for() doesn't mess up query parameter hash in the caller");
+}
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_with.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_with.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_core_uri_with.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More tests => 10;
use URI;
use_ok('Catalyst::Request');
@@ -48,3 +48,22 @@
'http://127.0.0.1/foo/bar/baz?bar=snort',
'URI changes param'
);
+
+is(
+ $request2->uri_with({ bar => [ 'snort', 'ewok' ] }),
+ 'http://127.0.0.1/foo/bar/baz?bar=snort&bar=ewok',
+ 'overwrite mode URI appends arrayref param'
+);
+
+is(
+ $request2->uri_with({ bar => 'snort' }, { mode => 'append' }),
+ 'http://127.0.0.1/foo/bar/baz?bar=gorch&bar=snort',
+ 'append mode URI appends param'
+);
+
+is(
+ $request2->uri_with({ bar => [ 'snort', 'ewok' ] }, { mode => 'append' }),
+ 'http://127.0.0.1/foo/bar/baz?bar=gorch&bar=snort&bar=ewok',
+ 'append mode URI appends arrayref param'
+);
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_load_catalyst_test.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_load_catalyst_test.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_load_catalyst_test.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -24,7 +24,7 @@
);
### make sure we're not trying to connect to a remote host -- these are local tests
-local $ENV{CATALYST_SERVER};
+local $ENV{CATALYST_SERVER};
use_ok( $Class );
@@ -38,7 +38,7 @@
while( my($class, $meths) = each %Meth ) {
for my $meth ( @$meths ) { SKIP: {
-
+
### method available?
can_ok( $class, $meth );
@@ -48,39 +48,39 @@
### check error conditions
eval { $class->can($meth)->( $Url ) };
ok( $@, " $meth without app gives error" );
- like( $@, qr/$Class/,
+ like( $@, qr/$Class/,
" Error filled with expected content for '$meth'" );
- } }
+ } }
}
-}
-
-### simple tests for exported methods
+}
+
+### simple tests for exported methods
{ ### turn of redefine warnings, we'll get new subs exported
### XXX 'no warnings' and 'local $^W' wont work as warnings are turned on in
### test.pm, so trap them for now --kane
{ local $SIG{__WARN__} = sub {};
- ok( $Class->import( $App ),
+ ok( $Class->import( $App ),
"Loading $Class for App $App" );
}
-
+
### test exported methods again
for my $meth ( @{ $Meth{$Pkg} } ) { SKIP: {
### do a call, we should get a result and perhaps a $c if it's 'ctx_request';
my ($res, $c) = eval { $Pkg->can($meth)->( $Url ) };
-
+
ok( 1, " Called $Pkg->$meth( $Url )" );
ok( !$@, " No critical error $@" );
ok( $res, " Result obtained" );
-
+
### get the content as a string, to make sure we got what we expected
my $res_as_string = $meth eq 'get' ? $res : $res->content;
is( $res_as_string, $Content,
- " Content as expected: $res_as_string" );
-
+ " Content as expected: $res_as_string" );
+
### some tests for 'ctx_request'
skip "Context tests skipped for '$meth'", 6 unless $meth eq 'ctx_request';
-
+
ok( $c, " Context object returned" );
isa_ok( $c, $App, " Object" );
is( $c->request->uri, $Url,
@@ -92,7 +92,7 @@
} }
}
-### perl5.8.8 + cat 5.80's Cat::Test->ctx_request didn't return $c the 2nd
+### perl5.8.8 + cat 5.80's Cat::Test->ctx_request didn't return $c the 2nd
### time it was invoked. Without tracking the bug down all the way, it was
### clearly related to the Moose'ification of Cat::Test and a scoping issue
### with a 'my'd variable. Since the same code works fine in 5.10, a bug in
@@ -102,7 +102,7 @@
my($res, $c) = ctx_request( $Url );
ok( $c, " Call $_: Context object returned" );
}
-}
+}
# FIXME - These vhosts in tests tests should be somewhere else...
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_metaclass_compat_non_moose_controller.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_metaclass_compat_non_moose_controller.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_metaclass_compat_non_moose_controller.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,23 +1,12 @@
-use Catalyst ();
+use strict;
+use warnings;
-{
- package TestApp;
- use base qw/Catalyst/;
-}
-{
- package TestApp::Controller::Base;
- use base qw/Catalyst::Controller/;
-}
-{
- package TestApp::Controller::Other;
- use base qw/TestApp::Controller::Base/;
-}
+use FindBin;
+use lib "$FindBin::Bin/lib";
-TestApp->setup_component('TestApp::Controller::Other');
-TestApp->setup_component('TestApp::Controller::Base');
-
use Test::More tests => 1;
use Test::Exception;
+use TestAppNonMooseController;
# Metaclass init order causes fail.
# There are TODO tests in Moose for this, see
@@ -25,6 +14,6 @@
# after which the evil kludge in core can die in a fire.
lives_ok {
- TestApp::Controller::Base->get_action_methods
+ TestAppNonMooseController::ControllerBase->get_action_methods
} 'Base class->get_action_methods ok when sub class initialized first';
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_response.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_response.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_response.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 6;
use_ok('Catalyst::Response');
@@ -12,3 +12,7 @@
is($res->status, 500, 'code sets status');
$res->status(501);
is($res->code, 501, 'status sets code');
+is($res->body, '', "default response body ''");
+$res->body(undef);
+is($res->body, '', "response body '' after assigned undef");
+
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/unit_stats.t
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/unit_stats.t 2009-09-05 15:16:48 UTC (rev 11324)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/unit_stats.t 2009-09-05 15:21:21 UTC (rev 11325)
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 12;
+use Test::More tests => 13;
use Time::HiRes qw/gettimeofday/;
use Tree::Simple;
@@ -19,6 +19,8 @@
my $stats = Catalyst::Stats->new;
is (ref($stats), "Catalyst::Stats", "new");
+ is_deeply([ $stats->created ], [0, 0], "created time");
+
my @expected; # level, string, time
$fudge_t[0] = 1;
More information about the Catalyst-commits
mailing list