Merge 'trunk' into 'better_scripts'
Tomas Doran [Sat, 5 Sep 2009 15:21:21 +0000 (15:21 +0000)]
r10660@tomas-dorans-macbook-pro (orig r10659):  caelum | 2009-06-25 10:37:35 +0100
 r5555@hlagh (orig r10585):  caelum | 2009-06-18 12:42:15 -0700
 new branch
 r5556@hlagh (orig r10586):  caelum | 2009-06-18 14:38:40 -0700
 made a failing test
 r5585@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@hlagh (orig r10601):  caelum | 2009-06-19 17:19:18 -0700
 minor change
 r5587@hlagh (orig r10602):  caelum | 2009-06-19 22:11:53 -0700
 nicer action sorting for Path
 r5595@hlagh (orig r10604):  caelum | 2009-06-20 10:18:53 -0700
 minor changes
 r5599@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@hlagh (orig r10610):  caelum | 2009-06-20 18:06:01 -0700
 forgot to add a file
 r5616@hlagh (orig r10611):  caelum | 2009-06-21 19:17:29 -0700
 missing / in test file
 r5676@hlagh (orig r10645):  caelum | 2009-06-24 17:41:38 -0700
 add C::DispatchType::_is_low_precedence

r10662@tomas-dorans-macbook-pro (orig r10661):  caelum | 2009-06-25 10:49:35 +0100
 r5367@hlagh (orig r10459):  t0m | 2009-06-06 05:56:50 -0700
 Branch for mo namespace handling refactor

 r5368@hlagh (orig r10460):  mo | 2009-06-06 06:33:53 -0700
 refactor of namespace handling
 r5369@hlagh (orig r10461):  mo | 2009-06-06 06:34:42 -0700
 TODO fix
 r5371@hlagh (orig r10466):  mo | 2009-06-07 04:14:23 -0700
 controller actions without attributes which are defined via config
 r5372@hlagh (orig r10467):  mo | 2009-06-07 04:49:58 -0700
 removed commented code
 r5373@hlagh (orig r10468):  mo | 2009-06-07 05:28:53 -0700
 Added support for ~ prefix to plugins and action classes
 r5374@hlagh (orig r10469):  mo | 2009-06-07 05:36:55 -0700
 Changes patches
 r5686@hlagh (orig r10655):  caelum | 2009-06-24 19:22:27 -0700
 cleanup TODO

r10669@tomas-dorans-macbook-pro (orig r10668):  rafl | 2009-06-26 16:26:42 +0100
Properly clean namespaces in Catalyst::Exception*.
r10670@tomas-dorans-macbook-pro (orig r10669):  rafl | 2009-06-26 16:26:56 +0100
Add a message attribute to Exception::Base.
r10671@tomas-dorans-macbook-pro (orig r10670):  rafl | 2009-06-26 16:27:05 +0100
Make exception stringify as their message.
r10672@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@tomas-dorans-macbook-pro (orig r10672):  rafl | 2009-06-26 16:27:30 +0100
Enable overloading fallback for Catalyst::Exception.
r10674@tomas-dorans-macbook-pro (orig r10673):  rafl | 2009-06-26 16:27:42 +0100
Add exception classes for the redispatching exceptions.
r10675@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@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@tomas-dorans-macbook-pro (orig r10676):  rafl | 2009-06-26 16:28:14 +0100
Add a rethrow method to Exception.
r10678@tomas-dorans-macbook-pro (orig r10677):  rafl | 2009-06-26 16:28:24 +0100
Make Exception initialisation saner.
r10679@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@tomas-dorans-macbook-pro (orig r10679):  rafl | 2009-06-26 18:11:08 +0100
Add Catalyst::Component::ContextClosure.
r10681@tomas-dorans-macbook-pro (orig r10680):  rafl | 2009-06-26 18:34:25 +0100
Add docs for ContextClosure.
r10682@tomas-dorans-macbook-pro (orig r10681):  rafl | 2009-06-26 20:45:30 +0100
Add test for ContextClosure.
r10683@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@tomas-dorans-macbook-pro (orig r10684):  rafl | 2009-06-26 20:50:14 +0100
stub pod for Exception::Go and ::Detach.
r10686@tomas-dorans-macbook-pro (orig r10685):  rafl | 2009-06-26 21:15:35 +0100
Changelogging.
r10687@tomas-dorans-macbook-pro (orig r10686):  rafl | 2009-06-26 21:31:50 +0100
Moar changelogging.
r10691@tomas-dorans-macbook-pro (orig r10690):  rafl | 2009-06-27 14:26:01 +0100
Bump deps for test aggregation.
r10692@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@tomas-dorans-macbook-pro (orig r10692):  rafl | 2009-06-27 14:56:36 +0100
Don't screw the prove -l user too hard.
r10700@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@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@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@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@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@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@tomas-dorans-macbook-pro (orig r10725):  caelum | 2009-06-29 17:49:44 +0100
remove Action::sort_order
r10727@tomas-dorans-macbook-pro (orig r10726):  caelum | 2009-06-29 17:54:55 +0100
remove cmp overload in Action
r10729@tomas-dorans-macbook-pro (orig r10728):  caelum | 2009-06-29 18:06:21 +0100
add note about overloaded <=>
r10730@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@tomas-dorans-macbook-pro (orig r10730):  rafl | 2009-06-29 23:05:02 +0100
Remove <=> overloading for actions.
r10732@tomas-dorans-macbook-pro (orig r10731):  rafl | 2009-06-29 23:05:12 +0100
Remove useless asignment.
r10733@tomas-dorans-macbook-pro (orig r10732):  rafl | 2009-06-29 23:05:25 +0100
Actually use make_context_closure correctly in the tests.
r10734@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@tomas-dorans-macbook-pro (orig r10734):  rafl | 2009-06-29 23:05:48 +0100
Version 0.80006.
r10737@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@tomas-dorans-macbook-pro (orig r10739):  edenc | 2009-06-30 16:13:45 +0100
added test case + patch for inherited action configuration
r10741@tomas-dorans-macbook-pro (orig r10740):  edenc | 2009-06-30 16:21:22 +0100
updated Changes
r10742@tomas-dorans-macbook-pro (orig r10741):  gphat | 2009-06-30 16:24:37 +0100
Add new uri_with mode for appending.

r10743@tomas-dorans-macbook-pro (orig r10742):  gphat | 2009-06-30 16:25:45 +0100
Claim my work, in case it breaks. ;)

r10744@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@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@tomas-dorans-macbook-pro (orig r10755):  rafl | 2009-06-30 22:26:15 +0100
Pretend that Catalyst.pm does Component::ApplicationAttribute.
r10757@tomas-dorans-macbook-pro (orig r10756):  rafl | 2009-06-30 22:30:38 +0100
Changelogging.
r10758@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@tomas-dorans-macbook-pro (orig r10758):  t0m | 2009-06-30 22:57:12 +0100
Add missed bug fixes to changelog
r10760@tomas-dorans-macbook-pro (orig r10759):  rafl | 2009-06-30 23:09:48 +0100
Version 5.80007.
r10781@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@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@tomas-dorans-macbook-pro (orig r10782):  rafl | 2009-07-04 00:31:59 +0100
Stop writing META.yml twice.
r10784@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@tomas-dorans-macbook-pro (orig r10784):  rafl | 2009-07-04 00:52:44 +0100
Unfuck indenting.
r10802@tomas-dorans-macbook-pro (orig r10801):  t0m | 2009-07-05 23:51:39 +0100
Fix warning, and only warn if really needed
r10824@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@tomas-dorans-macbook-pro (orig r10830):  t0m | 2009-07-08 21:11:57 +0100
U R DOIN IT WRONG.
r10836@tomas-dorans-macbook-pro (orig r10835):  t0m | 2009-07-08 23:12:29 +0100
More ->config fixes + Changelog
r10852@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@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@tomas-dorans-macbook-pro (orig r10864):  t0m | 2009-07-12 01:56:51 +0100
Fix test
r10866@tomas-dorans-macbook-pro (orig r10865):  t0m | 2009-07-12 01:57:19 +0100
Refactor to remove warning
r10885@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@tomas-dorans-macbook-pro (orig r10891):  dandv | 2009-07-16 02:12:59 +0100
Fixed POD links to get and request
r10893@tomas-dorans-macbook-pro (orig r10892):  dandv | 2009-07-16 06:24:10 +0100
Could not have made a more insignificant patch
r10898@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@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@tomas-dorans-macbook-pro (orig r10899):  t0m | 2009-07-16 22:24:11 +0100
Write that down
r10915@tomas-dorans-macbook-pro (orig r10914):  dandv | 2009-07-17 06:18:22 +0100
Hyperlinked POD entry for Catalysy::Request->args
r10941@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@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@tomas-dorans-macbook-pro (orig r10962):  hobbs | 2009-07-23 10:32:08 +0100
Test and Changelog entry for r10961.

r10981@tomas-dorans-macbook-pro (orig r10980):  t0m | 2009-07-25 22:05:19 +0100
Remove dead and unused method
r10985@tomas-dorans-macbook-pro (orig r10984):  autarch | 2009-07-26 03:14:23 +0100
fix spelling of attributes in the test name
r10986@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@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@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@tomas-dorans-macbook-pro (orig r10995):  hobbs | 2009-07-29 01:59:19 +0100
Update Changes and add me to Contributors
r10997@tomas-dorans-macbook-pro (orig r10996):  hobbs | 2009-07-29 02:06:09 +0100
Add konobi to contributors
r10998@tomas-dorans-macbook-pro (orig r10997):  hobbs | 2009-07-29 02:35:11 +0100
Changes entry for r10993
r11009@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@tomas-dorans-macbook-pro (orig r11012):  t0m | 2009-07-31 02:46:00 +0100
Large TODO update
r11019@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@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@tomas-dorans-macbook-pro (orig r11023):  caelum | 2009-08-01 20:04:08 +0100
allow uri_for($controller_instance)
r11035@tomas-dorans-macbook-pro (orig r11034):  t0m | 2009-08-05 20:39:01 +0100
Require perl 5.8.6
r11038@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@tomas-dorans-macbook-pro (orig r11047):  t0m | 2009-08-07 01:15:04 +0100
Fix the perl version required there also
r11049@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@tomas-dorans-macbook-pro (orig r11049):  t0m | 2009-08-07 01:57:21 +0100
Bump MX::MA dep for anon class tests
r11058@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@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@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@tomas-dorans-macbook-pro (orig r11063):  groditi | 2009-08-08 22:54:04 +0100
make debug output prettier with large widths
r11065@tomas-dorans-macbook-pro (orig r11064):  groditi | 2009-08-08 22:54:46 +0100
oops debug output got leaked in
r11069@tomas-dorans-macbook-pro (orig r11068):  t0m | 2009-08-09 13:36:20 +0100
Fix RT#48555
r11070@tomas-dorans-macbook-pro (orig r11069):  t0m | 2009-08-09 13:36:55 +0100
Updates changelog
r11071@tomas-dorans-macbook-pro (orig r11070):  t0m | 2009-08-09 15:22:21 +0100
Rewrite fixes for RT#48555
r11123@tomas-dorans-macbook-pro (orig r11122):  t0m | 2009-08-11 22:49:37 +0100
Unfuck Catalyst::View::JSON
r11125@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@tomas-dorans-macbook-pro (orig r11126):  rjbs | 2009-08-12 00:33:18 +0100
svn merge -r 11123:11125 branches/locate_components/ trunk/
r11128@tomas-dorans-macbook-pro (orig r11127):  rjbs | 2009-08-12 00:34:12 +0100
add changelog entry for merged locate_components branch
r11130@tomas-dorans-macbook-pro (orig r11129):  t0m | 2009-08-12 01:15:51 +0100
Tiny change to make the error make more sense
r11132@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@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@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@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@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@tomas-dorans-macbook-pro (orig r11144):  jshirley | 2009-08-17 22:33:17 +0100
Adding and documented X-Forwarded-Port
r11146@tomas-dorans-macbook-pro (orig r11145):  t0m | 2009-08-17 23:08:19 +0100
Capitalisation fixes in Changelog
r11147@tomas-dorans-macbook-pro (orig r11146):  t0m | 2009-08-17 23:11:34 +0100
Add _component_name stuff to Changes
r11148@tomas-dorans-macbook-pro (orig r11147):  jshirley | 2009-08-17 23:13:05 +0100
Conflict resolution
r11149@tomas-dorans-macbook-pro (orig r11148):  hobbs | 2009-08-17 23:24:46 +0100
Changelog for r11037

r11150@tomas-dorans-macbook-pro (orig r11149):  t0m | 2009-08-18 00:14:38 +0100
Switch to catalyst_component_name
r11154@tomas-dorans-macbook-pro (orig r11153):  ferz | 2009-08-18 07:55:14 +0100
Test case using Exception::Class

r11155@tomas-dorans-macbook-pro (orig r11154):  ferz | 2009-08-18 12:19:40 +0100
drop POD comments.

r11166@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@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@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@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@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@tomas-dorans-macbook-pro (orig r11170):  rafl | 2009-08-19 21:45:45 +0100
Changelog Engine::finalize_body changes.
r11181@tomas-dorans-macbook-pro (orig r11180):  gbjk | 2009-08-21 14:07:54 +0100
Changelog update for previous Catalyst::Engine::HTTP fix.

r11182@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@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@tomas-dorans-macbook-pro (orig r11183):  rafl | 2009-08-21 17:13:05 +0100
Version 5.80008.
r11190@tomas-dorans-macbook-pro (orig r11189):  t0m | 2009-08-21 20:54:58 +0100
Fix and tests for big issue in 5.80008
r11191@tomas-dorans-macbook-pro (orig r11190):  rafl | 2009-08-21 21:28:30 +0100
Version 5.80009.
r11193@tomas-dorans-macbook-pro (orig r11192):  rafl | 2009-08-21 21:55:25 +0100
DOH! do more than one read, if necessary.
r11194@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@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@tomas-dorans-macbook-pro (orig r11195):  rafl | 2009-08-21 22:31:38 +0100
Changelogging.
r11197@tomas-dorans-macbook-pro (orig r11196):  rafl | 2009-08-21 22:41:05 +0100
Version 5.80010.
r11215@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@tomas-dorans-macbook-pro (orig r11217):  rafl | 2009-08-23 12:46:42 +0100
Changelogging.
r11219@tomas-dorans-macbook-pro (orig r11218):  rafl | 2009-08-23 12:55:48 +0100
Version 5.80011.
r11221@tomas-dorans-macbook-pro (orig r11220):  rafl | 2009-08-23 19:42:17 +0100
Failing test for component loading
r11233@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@tomas-dorans-macbook-pro (orig r11238):  t0m | 2009-08-25 12:25:54 +0100
0003-Remove-diag-message.patch (marcus)
r11240@tomas-dorans-macbook-pro (orig r11239):  t0m | 2009-08-25 12:26:15 +0100
Fix duplicate components
r11252@tomas-dorans-macbook-pro (orig r11251):  frew | 2009-08-26 20:00:01 +0100
Look!  I'm famous!  (See Catalyst-Devel)
r11254@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@tomas-dorans-macbook-pro (orig r11277):  t0m | 2009-09-01 02:07:23 +0100
Nuke skipped test which will never pass
r11279@tomas-dorans-macbook-pro (orig r11278):  t0m | 2009-09-01 02:07:47 +0100
Author tests
r11280@tomas-dorans-macbook-pro (orig r11279):  t0m | 2009-09-01 02:09:29 +0100
t/author in MANFEST
r11281@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@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@tomas-dorans-macbook-pro (orig r11282):  t0m | 2009-09-01 02:11:45 +0100
Changelog
r11300@tomas-dorans-macbook-pro (orig r11292):  t0m | 2009-09-01 15:11:05 +0100
Bump versions back to 5.8.4
r11301@tomas-dorans-macbook-pro (orig r11293):  t0m | 2009-09-01 15:32:46 +0100
Changes tweaks
r11307@tomas-dorans-macbook-pro (orig r11299):  t0m | 2009-09-02 03:03:58 +0100
Changelogging

16 files changed:
Makefile.PL
TODO.scripts [new file with mode: 0644]
lib/Catalyst.pm
lib/Catalyst/ROADMAP.pod
lib/Catalyst/Script/CGI.pm [new file with mode: 0644]
lib/Catalyst/Script/Create.pm [new file with mode: 0644]
lib/Catalyst/Script/FastCGI.pm [new file with mode: 0644]
lib/Catalyst/Script/Server.pm [new file with mode: 0644]
lib/Catalyst/Script/Test.pm [new file with mode: 0644]
lib/Catalyst/ScriptRole.pm [new file with mode: 0644]
lib/Catalyst/ScriptRunner.pm [new file with mode: 0644]
t/lib/Catalyst/Script/Bar.pm [new file with mode: 0644]
t/lib/Catalyst/Script/Baz.pm [new file with mode: 0644]
t/lib/ScriptTestApp/Script/Bar.pm [new file with mode: 0644]
t/lib/ScriptTestApp/Script/Foo.pm [new file with mode: 0644]
t/unit_core_scriptrunner.t [new file with mode: 0644]

index 6fae99a..1bede30 100644 (file)
@@ -16,6 +16,7 @@ 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';
@@ -44,10 +45,10 @@ 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
 
-recommends 'B::Hooks::OP::Check::StashChange';
-
 test_requires 'Class::Data::Inheritable';
 test_requires 'Test::Exception';
 
diff --git a/TODO.scripts b/TODO.scripts
new file mode 100644 (file)
index 0000000..f6a69c0
--- /dev/null
@@ -0,0 +1,6 @@
+* Fix the fucking help to be consistent again!
+* Documentation
+* Proper test of all the options on all the scripts
+* ScriptRunner tests for MyApp::Script::DoesNotCompile
+
+* Tests for Scripts / Role
index f616ba8..56f0f93 100644 (file)
@@ -2786,6 +2786,8 @@ David Naughton, C<naughton@umn.edu>
 
 David E. Wheeler
 
+dhoss: Devin Austin <dhoss@cpan.org>
+
 dkubb: Dan Kubb <dan.kubb-cpan@onautopilot.com>
 
 Drew Taylor
index e872e5e..9c29d1d 100644 (file)
@@ -8,11 +8,6 @@ in the the catalyst trunk, currently at
 
 Make sure you get it from there to ensure you have the latest version.
 
-=head2 5.80000 1st Quarter 2009
-
-Next major planned release, ports Catalyst to Moose, and does some refactoring
-to help app/ctx.
-
 =head2 5.81000 
 
 =over
diff --git a/lib/Catalyst/Script/CGI.pm b/lib/Catalyst/Script/CGI.pm
new file mode 100644 (file)
index 0000000..c37dfdc
--- /dev/null
@@ -0,0 +1,31 @@
+package Catalyst::Script::CGI;
+use Moose;
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+__PACKAGE__->meta->make_immutable;
+
+=head1 NAME
+
+Catalyst::Script::CGI - The CGI Catalyst Script
+
+=head1 SYNOPSIS
+
+See L<Catalyst>.
+
+=head1 DESCRIPTION
+
+This is a script to run the Catalyst engine specialized for the CGI environment.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
diff --git a/lib/Catalyst/Script/Create.pm b/lib/Catalyst/Script/Create.pm
new file mode 100644 (file)
index 0000000..575f9e7
--- /dev/null
@@ -0,0 +1,94 @@
+package Catalyst::Script::Create;
+use Moose;
+use Catalyst::Helper;
+use MooseX::Types::Moose qw/Bool/;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+has force => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'nonew',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'Force new scripts',
+);
+
+has debug => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'd',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'Force debug mode',
+);
+
+has mechanize => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'mech',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'use WWW::Mechanize',
+);
+
+sub run {
+    my ($self) = @_;
+
+    $self->_display_help if ( !$ARGV[0] );
+
+    my $helper = Catalyst::Helper->new( { '.newfiles' => !$self->force, mech => $self->mech } );
+
+    $self->_display_help unless $helper->mk_component( $self->app, @ARGV );
+
+}
+
+__PACKAGE__->meta->make_immutable;
+1;
+
+=head1 NAME
+
+Catalyst::Script::Create - Create a new Catalyst Component
+
+=head1 SYNOPSIS
+
+ myapp_create.pl [options] model|view|controller name [helper] [options]
+
+ Options:
+   -force        don't create a .new file where a file to be created exists
+   -mechanize    use Test::WWW::Mechanize::Catalyst for tests if available
+   -help         display this help and exits
+
+ Examples:
+   myapp_create.pl controller My::Controller
+   myapp_create.pl controller My::Controller BindLex
+   myapp_create.pl -mechanize controller My::Controller
+   myapp_create.pl view My::View
+   myapp_create.pl view MyView TT
+   myapp_create.pl view TT TT
+   myapp_create.pl model My::Model
+   myapp_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
+   dbi:SQLite:/tmp/my.db
+   myapp_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
+   dbi:Pg:dbname=foo root 4321
+
+ See also:
+   perldoc Catalyst::Manual
+   perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Create a new Catalyst Component.
+
+Existing component files are not overwritten.  If any of the component files
+to be created already exist the file will be written with a '.new' suffix.
+This behavior can be suppressed with the C<-force> option.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
diff --git a/lib/Catalyst/Script/FastCGI.pm b/lib/Catalyst/Script/FastCGI.pm
new file mode 100644 (file)
index 0000000..edfcea0
--- /dev/null
@@ -0,0 +1,103 @@
+package Catalyst::Script::FastCGI;
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
+use Moose;
+use MooseX::Types::Moose qw/Str Bool Int/;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+has listen => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'l',
+    isa => Int,
+    is => 'ro',
+    documentation => 'Specify a listening port/socket',
+);
+
+has pidfile => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'pid',
+    isa => Str,
+    is => 'ro',
+    documentation => 'Specify a pidfile',
+);
+
+has daemon => (
+    traits => [qw(Getopt)],
+    isa => Bool,   
+    is => 'ro', 
+    cmd_aliases => 'd', 
+    documentation => 'Daemonize',
+);
+
+has manager => (
+    traits => [qw(Getopt)],
+    isa => Str,    
+    is => 'ro',
+    cmd_aliases => 'm',
+    documentation => 'Use a different FastCGI manager', # FIXME
+);
+
+has keep_stderr => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'std', 
+    isa => Bool,   
+    is => 'ro',  
+    documentation => 'Log STDERR',
+);
+
+has nproc => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'np',  
+    isa => Int,
+    is => 'ro',  
+    documentation => 'Specify an nproc', # FIXME
+);
+
+has detach => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'det', 
+    isa => Bool,   
+    is => 'ro',  
+    documentation => 'Detach this FastCGI process',
+);
+
+sub _application_args {
+    my ($self) = shift;
+    return (
+        $self->listen,
+        {
+            nproc   => $self->nproc,
+            pidfile => $self->pidfile,
+            manager => $self->manager,
+            detach  => $self->detach,
+            keep_stderr => $self->keep_stderr,
+        }
+    );
+}
+
+__PACKAGE__->meta->make_immutable;
+
+=head1 NAME
+
+Catalyst::Script::FastCGI - The FastCGI Catalyst Script
+
+=head1 SYNOPSIS
+
+See L<Catalyst>.
+
+=head1 DESCRIPTION
+
+FIXME
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
diff --git a/lib/Catalyst/Script/Server.pm b/lib/Catalyst/Script/Server.pm
new file mode 100644 (file)
index 0000000..1c3cf99
--- /dev/null
@@ -0,0 +1,236 @@
+package Catalyst::Script::Server;
+
+BEGIN {
+    $ENV{CATALYST_ENGINE} ||= 'HTTP';
+    require Catalyst::Engine::HTTP;
+}
+
+use Moose;
+use Catalyst::Restarter;
+use MooseX::Types::Moose qw/ArrayRef Str Bool Int/;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+has debug => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'd',
+    isa => Bool,
+    is => 'ro',
+    documentation => q{Force debug mode},
+);
+
+has host => (
+    traits => [qw(Getopt)],
+    isa => Str,
+    is => 'ro',
+    default => 'localhost',
+    documentation => 'Specify a host for the server to run on',
+);
+
+has fork => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'f',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'Fork the server',
+);
+
+has listen => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'l',
+    isa => Int,
+    is => 'ro',
+    default => 3000,
+    documentation => 'Specify a different listening port',
+);
+
+has pidfile => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'pid',
+    isa => Str,
+    is => 'ro',
+    documentation => 'Specify a pidfile',
+);
+
+has keepalive => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'k',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'Server keepalive',
+
+);
+
+has background => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'bg',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'Run in the background',
+);
+
+has restart => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'r',
+    isa => Bool,
+    is => 'ro',
+    documentation => 'use Catalyst::Restarter to detect code changes',
+);
+
+has restart_directory => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'rdir',
+    isa => ArrayRef[Str],
+    is  => 'ro',
+    predicate => '_has_restart_directory',
+    documentation => 'Restarter directory to watch',
+);
+
+has restart_delay => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'rdel',
+    isa => Int,
+    is => 'ro',
+    predicate => '_has_restart_delay',
+    documentation => 'Set a restart delay',
+);
+
+has restart_regex => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'rxp',
+    isa => Str,
+    is => 'ro',
+    predicate => '_has_restart_regex',
+    documentation => 'Restart regex',
+);
+
+has follow_symlinks => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'sym',
+    isa => Bool,
+    is => 'ro',
+    predicate => '_has_follow_symlinks',
+    documentation => 'Follow symbolic links',
+
+);
+
+sub run {
+    my ($self) = shift;
+
+    if ( $self->debug ) {
+        $ENV{CATALYST_DEBUG} = 1;
+    }
+
+    # If we load this here, then in the case of a restarter, it does not
+    # need to be reloaded for each restart.
+    require Catalyst;
+
+    # If this isn't done, then the Catalyst::Devel tests for the restarter
+    # fail.
+    $| = 1 if $ENV{HARNESS_ACTIVE};
+
+    if ( $self->restart ) {
+        die "Cannot run in the background and also watch for changed files.\n"
+            if $self->background;
+
+        require Catalyst::Restarter;
+
+        my $subclass = Catalyst::Restarter->pick_subclass;
+
+        my %args;
+        $args{follow_symlinks} = $self->follow_symlinks
+            if $self->_has_follow_symlinks;
+        $args{directories}     = $self->restart_directory
+            if $self->_has_restart_directory;
+        $args{sleep_interval}  = $self->restart_delay
+            if $self->_has_restart_delay;
+        $args{filter} = qr/$self->restart_regex/
+            if $self->_has_restart_regex;
+
+        my $restarter = $subclass->new(
+            %args,
+            start_sub => sub { $self->_run },
+            argv      => \$self->ARGV,
+        );
+
+        $restarter->run_and_watch;
+    }
+    else {
+        $self->_run_application;
+    }
+
+
+}
+
+sub _application_args {
+    my ($self) = shift;
+    return (
+        $self->listen,
+        $self->host,
+        {
+           map { $_ => $self->$_ } qw/
+                fork
+                keepalive
+                background
+                pidfile
+                keepalive
+                follow_symlinks
+            /,
+        },
+    );
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+=head1 NAME
+
+Catalyst::Script::Server - Catalyst test server
+
+=head1 SYNOPSIS
+
+ myapp_server.pl [options]
+
+ Options:
+   -d     --debug          force debug mode
+   -f     --fork           handle each request in a new process
+                      (defaults to false)
+   -h     --help           display this help and exits
+          --host           host (defaults to all)
+   -p     --port           port (defaults to 3000)
+   -k     --keepalive      enable keep-alive connections
+   -r     --restart        restart when files get modified
+                       (defaults to false)
+   --rd   --restartdelay  delay between file checks
+                      (ignored if you have Linux::Inotify2 installed)
+   --rr   --restartregex  regex match files that trigger
+                      a restart when modified
+                      (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
+   --rdir --restartdirectory  the directory to search for
+                      modified files, can be set mulitple times
+                      (defaults to '[SCRIPT_DIR]/..')
+   --sym  --follow_symlinks   follow symlinks in search directories
+                      (defaults to false. this is a no-op on Win32)
+   --bg   --background        run the process in the background
+   --pid  --pidfile           specify filename for pid file
+
+ See also:
+   perldoc Catalyst::Manual
+   perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Run a Catalyst test server for this application.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
diff --git a/lib/Catalyst/Script/Test.pm b/lib/Catalyst/Script/Test.pm
new file mode 100644 (file)
index 0000000..f3da4e1
--- /dev/null
@@ -0,0 +1,41 @@
+package Catalyst::Script::Test;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run {
+    my $self = shift;
+
+    Class::MOP::load_class("Catalyst::Test");
+    Catalyst::Test->import($self->app);
+
+    print request($ARGV[1])->content  . "\n";
+
+}
+
+
+__PACKAGE__->meta->make_immutable;
+
+=head1 NAME
+
+Catalyst::Script::Test - Test Catalyst application on the command line
+
+=head1 SYNOPSIS
+
+See L<Catalyst>.
+
+=head1 DESCRIPTION
+
+FIXME
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
diff --git a/lib/Catalyst/ScriptRole.pm b/lib/Catalyst/ScriptRole.pm
new file mode 100644 (file)
index 0000000..aa319f3
--- /dev/null
@@ -0,0 +1,75 @@
+package Catalyst::ScriptRole;
+use Moose::Role;
+use MooseX::Types::Moose qw/Str Bool/;
+use Pod::Usage;
+use namespace::autoclean;
+
+with 'MooseX::Getopt';
+
+has application_name => (
+    traits => ['NoGetopt'],
+    isa => Str,
+    is => 'ro',
+    required => 1,
+);
+
+has help => (
+    traits => ['Getopt'],
+    cmd_aliases => 'h',
+    isa => Bool,
+    is => 'ro',
+    documentation => q{Display this help and exit},
+);
+
+sub _display_help {
+    my $self = shift;
+    pod2usage();
+    exit 0;
+}
+
+before run => sub {
+    my $self = shift;
+    $self->_display_help if $self->help;
+};
+
+sub run {
+    my $self = shift;
+    $self->_run_application;
+}
+
+sub _application_args {
+    ()
+}
+
+sub _run_application {
+    my $self = shift;
+    my $app = $self->application_name;
+    Class::MOP::load_class($app);
+    $app->run($self->_application_args);
+}
+
+1;
+
+=head1 NAME
+
+Catalyst::ScriptRole - Common functionality for Catalyst scripts.
+
+=head1 SYNOPSIS
+
+    FIXME
+    
+=head1 DESCRIPTION
+
+    FIXME    
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+    
\ No newline at end of file
diff --git a/lib/Catalyst/ScriptRunner.pm b/lib/Catalyst/ScriptRunner.pm
new file mode 100644 (file)
index 0000000..08fd66e
--- /dev/null
@@ -0,0 +1,50 @@
+package Catalyst::ScriptRunner;
+use Moose;
+use FindBin;
+use lib;
+use File::Spec;
+use namespace::autoclean;
+
+sub run {
+    my ($self, $class, $scriptclass) = @_;
+    my $classtoload = "${class}::Script::$scriptclass";
+
+    lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
+
+    # FIXME - Error handling / reporting
+    if ( eval { Class::MOP::load_class($classtoload) } ) {
+    }
+    else {
+        $classtoload = "Catalyst::Script::$scriptclass";
+        Class::MOP::load_class($classtoload);
+    }
+    $classtoload->new_with_options( application_name => $class )->run;
+}
+
+__PACKAGE__->meta->make_immutable;
+
+=head1 NAME
+
+Catalyst::ScriptRunner - The Catalyst Framework script runner
+
+=head1 SYNOPSIS
+
+    # Will run MyApp::Script::Server if it exists, otherwise
+    # will run Catalyst::Script::Server.
+    Catalyst::ScriptRunner->run('MyApp', 'Server');
+
+=head1 DESCRIPTION
+
+This class is responsible for running scripts, either in the application specific namespace
+(e.g. C<MyApp::Script::Server>), or the Catalyst namespace (e.g. C<Catalyst::Script::Server>)
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
diff --git a/t/lib/Catalyst/Script/Bar.pm b/t/lib/Catalyst/Script/Bar.pm
new file mode 100644 (file)
index 0000000..18e699c
--- /dev/null
@@ -0,0 +1,9 @@
+package Catalyst::Script::Bar;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+1;
diff --git a/t/lib/Catalyst/Script/Baz.pm b/t/lib/Catalyst/Script/Baz.pm
new file mode 100644 (file)
index 0000000..d699fe6
--- /dev/null
@@ -0,0 +1,16 @@
+package Catalyst::Script::Baz;
+use Moose;
+use namespace::autoclean;
+
+use Test::More;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+after new_with_options => sub {
+    my ($self, %args) = @_;
+    is_deeply \%args, { application_name => 'ScriptTestApp' }, 'App name correct';
+};
+
+1;
diff --git a/t/lib/ScriptTestApp/Script/Bar.pm b/t/lib/ScriptTestApp/Script/Bar.pm
new file mode 100644 (file)
index 0000000..1d01fad
--- /dev/null
@@ -0,0 +1,9 @@
+package ScriptTestApp::Script::Bar;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+1;
\ No newline at end of file
diff --git a/t/lib/ScriptTestApp/Script/Foo.pm b/t/lib/ScriptTestApp/Script/Foo.pm
new file mode 100644 (file)
index 0000000..8d61c63
--- /dev/null
@@ -0,0 +1,9 @@
+package ScriptTestApp::Script::Foo;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+1;
diff --git a/t/unit_core_scriptrunner.t b/t/unit_core_scriptrunner.t
new file mode 100644 (file)
index 0000000..b87afeb
--- /dev/null
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+use Test::More tests => 5;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+
+use_ok('Catalyst::ScriptRunner');
+
+is Catalyst::ScriptRunner->run('ScriptTestApp', 'Foo'), 'ScriptTestApp::Script::Foo',
+    'Script existing only in app';
+is Catalyst::ScriptRunner->run('ScriptTestApp', 'Bar'), 'ScriptTestApp::Script::Bar',
+    'Script existing in both app and Catalyst - prefers app';
+is Catalyst::ScriptRunner->run('ScriptTestApp', 'Baz'), 'Catalyst::Script::Baz',
+    'Script existing only in Catalyst';
+# +1 test for the params passed to new_with_options in t/lib/Catalyst/Script/Baz.pm
+