Re: [Catalyst] namespace problem

2009-11-25 Thread Eden Cardim
 Andrew == Andrew Rodland and...@cleverdomain.org writes:

Andrew For the sake of sanity, what you need to do is stop
Andrew inheriting from a concrete controller. It really doesn't
Andrew make a lot of sense and there are a lot of ways it could
Andrew break something. As Moritz writes, if you need a controller
Andrew base class, write a controller base class and inherit from
Andrew that.

Or even better, write a role instead.

-- 
   Eden Cardim   Need help with your Catalyst or DBIx::Class project?
  Code Monkeyhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://edenc.vox.com/http://www.shadowcat.co.uk/servers/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Organize tests in sub-directories

2009-11-25 Thread Tomas Doran


On 24 Nov 2009, at 20:31, Octavian Râşniţă wrote:
I would like to structure the t directory as lib/MyApp is  
structured. Is it possible to be able to configure the app somehow  
so `make test` checks all the test files even if they are in sub- 
directories?


Yes, you just say something like:

tests 't/*.t', 't/*/*.t', 't/*/*/*.t'; # However many levels deep you  
need


in Makefile.PL

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] local helper?

2009-11-25 Thread Octavian Râşniţă

Hi,

I've created in MyApp/lib the module

MyApp/lib/Catalyst/Helper/Model/MyHelper.pm

But I can't run it using

perl script/myapp_create.pl model MyModel MyHelper

because myapp_create.pl doesn't add the local lib to @INC so it can't find 
it.


Is there any reason the local lib is not added to @INC in myapp_create.pl, 
or it is added but I am doing something wrong?


Thanks.

Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] namespace problem

2009-11-25 Thread Octavian Râsnita

From: Eden Cardim edencar...@gmail.com

Andrew == Andrew Rodland and...@cleverdomain.org writes:


   Andrew For the sake of sanity, what you need to do is stop
   Andrew inheriting from a concrete controller. It really doesn't
   Andrew make a lot of sense and there are a lot of ways it could
   Andrew break something. As Moritz writes, if you need a controller
   Andrew base class, write a controller base class and inherit from
   Andrew that.

Or even better, write a role instead.



Is there any tutorial for using Moose roles in Catalyst?

Thanks.

Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Organize tests in sub-directories

2009-11-25 Thread Octavian Râşniţă

From: Tomas Doran bobtf...@bobtfish.net
On 24 Nov 2009, at 20:31, Octavian Râşniţă wrote:
I would like to structure the t directory as lib/MyApp is  structured. Is 
it possible to be able to configure the app somehow  so `make test` checks 
all the test files even if they are in sub- directories?


Yes, you just say something like:

tests 't/*.t', 't/*/*.t', 't/*/*/*.t'; # However many levels deep you
need
in Makefile.PL


This is good news. But unfortunately it executes only the tests from the t 
directory, not those from its subdirectories.


I have tried to put this line of code in more places in Makefile.PL with no 
difference.


Thanks.

Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] namespace problem

2009-11-25 Thread Tomas Doran

Octavian Râsnita wrote:

Is there any tutorial for using Moose roles in Catalyst?


http://search.cpan.org/~flora/Catalyst-Runtime-5.80014/lib/Catalyst/Upgrading.pod#Moose_features

http://search.cpan.org/~hkclark/Catalyst-Manual-5.8002/lib/Catalyst/Manual/CatalystAndMoose.pod

http://search.cpan.org/~flora/Moose-0.93/lib/Moose/Manual/Roles.pod


Cheers
t0m

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] local helper?

2009-11-25 Thread Tomas Doran

Octavian Râşniţă wrote:
because myapp_create.pl doesn't add the local lib to @INC so it can't 
find it.


Why would you want the helper in your application? I can't think of any 
task where an app-specific helper would be any use..


Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Organize tests in sub-directories

2009-11-25 Thread Wallace Reis
On 25/11/2009, at 09:36, Octavian Râşniţă wrote:
 This is good news. But unfortunately it executes only the tests from the t 
 directory, not those from its subdirectories.
 
 I have tried to put this line of code in more places in Makefile.PL with no 
 difference.


You can use tests_recursive from Module::Install::Makefile.

--
   wallace reis/wreis Catalyst and DBIx::Class consultancy with a clue
   Software Engineer  and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
http://www.shadowcat.co.uk http://www.linkedin.com/in/wallacereis
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] local helper?

2009-11-25 Thread Rodrigo
 But I can't run it using

 perl script/myapp_create.pl model MyModel MyHelper

 because myapp_create.pl doesn't add the local lib to @INC so it can't find
 it.


Have you tried:

perl -Ilib script/myapp_create.pl model MyModel MyHelper
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Organize tests in sub-directories

2009-11-25 Thread Octavian Râşniţă

From: Wallace Reis wall...@reis.org.br

On 25/11/2009, at 09:36, Octavian Râşniţă wrote:
This is good news. But unfortunately it executes only the tests from the t 
directory, not those from its subdirectories.


I have tried to put this line of code in more places in Makefile.PL with 
no difference.



You can use tests_recursive from Module::Install::Makefile.


Great! It works fine that way.

With this ocasion I've seen that the correct way of using tests() is not:

tests 't/*.t', 't/*/*.t', 't/*/*/*.t', 't/*/*/*/*.t', 't/*/*/*/*/*.t';

but probably

tests 't/*.t, */*.t';

(including all the file specifications in a single string)

Octavian



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/