Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Catalyst::Manual Questions For The Group

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


hkclark at gmail

Nov 15, 2009, 6:48 AM

Post #1 of 8 (2601 views)
Permalink
Catalyst::Manual Questions For The Group

Hi Everyone,

I have been working on resolving various Catalyst::Manual tickets and
getting a long-overdue release of the manual & tutorial out. I wanted to
get some input on a few of the tickets if i could:

1) #47363: Remove References to Old/New Ways of Doing Things
http://rt.cpan.org/Public/Bug/Display.html?id=47363

I took a look at some of these but I wasn't sure if I should start changing
things or not. It seems that every time I don't cover variation people
might run into if they aren't on the latest/recommended versions, then they
get "stuck" and frustrated. I agree that the "Note that if you are using
version XX of XX you ..." stuff can be distracting, but it seems like a
necessary evil (unless the issue is *really* old... I do try to eventually
prune those out). Thoughts?


2) #31164: Catalyst::Manual::Cookbook mod_perl configuration incorrect?
http://rt.cpan.org/Public/Bug/Display.html?id=31164

I'm not really a mod_perl user. Can anyone confirm if these changes are
correct? Here is the patch:

--- catalyst_manual_cookbook.pod.orig 2007-12-03 12:15:11.000000000 +0000
+++ catalyst_manual_cookbook.pod 2007-12-03 12:16:05.000000000 +0000
@@ -1483,8 +1483,10 @@
when run within mod_perl. This makes the configuration extremely easy.
Here is a basic Apache 2 configuration.

- PerlSwitches -I/var/www/MyApp/lib
- PerlModule MyApp
+ <Perl>
+ use lib '/var/www/MyApp/lib';
+ use MyApp;
+ </Perl>

<Location />
SetHandler modperl

3) #50953: missing information: action with various args numbers
http://rt.cpan.org/Public/Bug/Display.html?id=50953

User asks "what If I want to accept with 0, 1 or 2 but not anymore arguments
than that?"... my understanding is that you can specify an exact number of
:Args or omit it for any number, but not do a range of acceptable args. Can
anyone confirm if this is correct?


Thanks!
Kennedy


kiffin.gish at planet

Nov 15, 2009, 9:02 AM

Post #2 of 8 (2457 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

On Sun, 2009-11-15 at 09:48 -0500, hkclark [at] gmail wrote:
> I took a look at some of these but I wasn't sure if I should start
> changing things or not. It seems that every time I don't cover
> variation people might run into if they aren't on the
> latest/recommended versions, then they get "stuck" and frustrated. I
> agree that the "Note that if you are using version XX of XX you ..."
> stuff can be distracting, but it seems like a necessary evil (unless
> the issue is *really* old... I do try to eventually prune those out).
> Thoughts?

My preference would be to stick to the most recent version and remove
any references to older versions. You can make this very clear at the
beginning of the tutorial. Like you say, it's messy and distracting to
mix versions together in the manual.

If indeed there is a need for older versions, then you could include
some appendix listing the differences on what pages, but this could be
alot of extra work I realize.

> User asks "what If I want to accept with 0, 1 or 2 but not anymore
> arguments than that?"... my understanding is that you can specify an
> exact number of :Args or omit it for any number, but not do a range of
> acceptable args. Can anyone confirm if this is correct?

According to the Catalyst::DispatchType::Chained documentation:

By default, endpoints receive the rest of the arguments in the path. You
can tell Catalyst through :Args explicitly how many arguments your
endpoint expects, just like you can with :CaptureArgs. Note that this
also affects whether this chain is invoked on a request. A chain with an
endpoint specifying one argument will only match if exactly one argument
exists in the path.

You can specify an exact number of arguments like :Args(3), including 0.
If you just say :Args without any arguments, it is the same as leaving
it out altogether: The chain is matched regardless of the number of path
parts after the endpoint.



--
Kiffin Gish <Kiffin.Gish [at] planet>
Gouda, The Netherlands



_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


diment at gmail

Nov 15, 2009, 11:29 AM

Post #3 of 8 (2451 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

On 16/11/2009, at 1:48 AM, hkclark [at] gmail wrote:

> Hi Everyone,
>
> I have been working on resolving various Catalyst::Manual tickets and
> getting a long-overdue release of the manual & tutorial out. I
> wanted to
> get some input on a few of the tickets if i could:
>
> 1) #47363: Remove References to Old/New Ways of Doing Things
> http://rt.cpan.org/Public/Bug/Display.html?id=47363
>
> I took a look at some of these but I wasn't sure if I should start
> changing
> things or not. It seems that every time I don't cover variation
> people
> might run into if they aren't on the latest/recommended versions,
> then they
> get "stuck" and frustrated. I agree that the "Note that if you are
> using
> version XX of XX you ..." stuff can be distracting, but it seems
> like a
> necessary evil (unless the issue is *really* old... I do try to
> eventually
> prune those out). Thoughts?
>


I agree with Kiffin. Ideally there would be an appendix with some of
the more relevant ways of dealing with things listed in there.

>
> 2) #31164: Catalyst::Manual::Cookbook mod_perl configuration
> incorrect?
> http://rt.cpan.org/Public/Bug/Display.html?id=31164

One of the problems with mod_perl is that its sufficiently big and
complex enough that it's not trivial to have a spare mod_perl server
lying around. Maybe someone who has one anyway can confirm this

>
> I'm not really a mod_perl user. Can anyone confirm if these changes
> are
> correct? Here is the patch:
>
> --- catalyst_manual_cookbook.pod.orig 2007-12-03 12:15:11.000000000
> +0000
> +++ catalyst_manual_cookbook.pod 2007-12-03 12:16:05.000000000 +0000
> @@ -1483,8 +1483,10 @@
> when run within mod_perl. This makes the configuration extremely easy.
> Here is a basic Apache 2 configuration.
>
> - PerlSwitches -I/var/www/MyApp/lib
> - PerlModule MyApp
> + <Perl>
> + use lib '/var/www/MyApp/lib';
> + use MyApp;
> + </Perl>
>
> <Location />
> SetHandler modperl
>
> 3) #50953: missing information: action with various args numbers
> http://rt.cpan.org/Public/Bug/Display.html?id=50953
>
> User asks "what If I want to accept with 0, 1 or 2 but not anymore
> arguments
> than that?"... my understanding is that you can specify an exact
> number of
> :Args or omit it for any number, but not do a range of acceptable
> args. Can
> anyone confirm if this is correct?
>

You can only have varying URL Args for things at the end of the chain,
kind of by definition, so this is the :Args [nothing] use case. Then
you'd need to check length of the $c->req->args array ref manually in
your controller if you only wanted a certain range of trailing args.

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


devin.austin at gmail

Nov 15, 2009, 11:37 AM

Post #4 of 8 (2452 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

On Sun, Nov 15, 2009 at 12:29 PM, Kieren Diment <diment [at] gmail> wrote:

>
> On 16/11/2009, at 1:48 AM, hkclark [at] gmail wrote:
>
> Hi Everyone,
>>
>> I have been working on resolving various Catalyst::Manual tickets and
>> getting a long-overdue release of the manual & tutorial out. I wanted to
>> get some input on a few of the tickets if i could:
>>
>> 1) #47363: Remove References to Old/New Ways of Doing Things
>> http://rt.cpan.org/Public/Bug/Display.html?id=47363
>>
>> I took a look at some of these but I wasn't sure if I should start
>> changing
>> things or not. It seems that every time I don't cover variation people
>> might run into if they aren't on the latest/recommended versions, then
>> they
>> get "stuck" and frustrated. I agree that the "Note that if you are using
>> version XX of XX you ..." stuff can be distracting, but it seems like a
>> necessary evil (unless the issue is *really* old... I do try to eventually
>> prune those out). Thoughts?
>>
>>
>
> I agree with Kiffin. Ideally there would be an appendix with some of the
> more relevant ways of dealing with things listed in there.
>
>
>> 2) #31164: Catalyst::Manual::Cookbook mod_perl configuration incorrect?
>> http://rt.cpan.org/Public/Bug/Display.html?id=31164
>>
>
> One of the problems with mod_perl is that its sufficiently big and complex
> enough that it's not trivial to have a spare mod_perl server lying around.
> Maybe someone who has one anyway can confirm this
>
>
>> I'm not really a mod_perl user. Can anyone confirm if these changes are
>> correct? Here is the patch:
>>
>> --- catalyst_manual_cookbook.pod.orig 2007-12-03 12:15:11.000000000 +0000
>> +++ catalyst_manual_cookbook.pod 2007-12-03 12:16:05.000000000 +0000
>> @@ -1483,8 +1483,10 @@
>> when run within mod_perl. This makes the configuration extremely easy.
>> Here is a basic Apache 2 configuration.
>>
>> - PerlSwitches -I/var/www/MyApp/lib
>> - PerlModule MyApp
>> + <Perl>
>> + use lib '/var/www/MyApp/lib';
>> + use MyApp;
>> + </Perl>
>>
>> <Location />
>> SetHandler modperl
>>
>> 3) #50953: missing information: action with various args numbers
>> http://rt.cpan.org/Public/Bug/Display.html?id=50953
>>
>> User asks "what If I want to accept with 0, 1 or 2 but not anymore
>> arguments
>> than that?"... my understanding is that you can specify an exact number of
>> :Args or omit it for any number, but not do a range of acceptable args.
>> Can
>> anyone confirm if this is correct?
>>
>>
> You can only have varying URL Args for things at the end of the chain, kind
> of by definition, so this is the :Args [nothing] use case. Then you'd need
> to check length of the $c->req->args array ref manually in your controller
> if you only wanted a certain range of trailing args.
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev [at] lists
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>

This is pretty much purely cosmetic, but I think it'd be great if we could
start putting $c->stash examples in as $c->stash ( key => 'value' ); as it
looks a lot nicer than $c->stash->{key} = 'value'. Just my $0.02 :-)

--
Devin Austin
http://www.codedright.net
9702906669 - Cell


hkclark at gmail

Nov 18, 2009, 7:37 PM

Post #5 of 8 (2425 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

Thanks you for the replies. Comments inline below...

On Sun, Nov 15, 2009 at 12:02 PM, Kiffin Gish <kiffin.gish [at] planet> wrote:

> On Sun, 2009-11-15 at 09:48 -0500, hkclark [at] gmail wrote:
> > I took a look at some of these but I wasn't sure if I should start
> > changing things or not. It seems that every time I don't cover
> > variation people might run into if they aren't on the
> > latest/recommended versions, then they get "stuck" and frustrated. I
> > agree that the "Note that if you are using version XX of XX you ..."
> > stuff can be distracting, but it seems like a necessary evil (unless
> > the issue is *really* old... I do try to eventually prune those out).
> > Thoughts?
>
> My preference would be to stick to the most recent version and remove
> any references to older versions. You can make this very clear at the
> beginning of the tutorial. Like you say, it's messy and distracting to
> mix versions together in the manual.
>
> If indeed there is a need for older versions, then you could include
> some appendix listing the differences on what pages, but this could be
> alot of extra work I realize.
>
>
OK, based on the feedback from Kiffin and Kieren, I'll start working on
consolidating the historical stuff into an Appendix. It will take a fair
amount of work, so I probably won't do it all at once, but over time we
should be a be able to clean things up.


> > User asks "what If I want to accept with 0, 1 or 2 but not anymore
> > arguments than that?"... my understanding is that you can specify an
> > exact number of :Args or omit it for any number, but not do a range of
> > acceptable args. Can anyone confirm if this is correct?
>
> According to the Catalyst::DispatchType::Chained documentation:
>
> By default, endpoints receive the rest of the arguments in the path. You
> can tell Catalyst through :Args explicitly how many arguments your
> endpoint expects, just like you can with :CaptureArgs. Note that this
> also affects whether this chain is invoked on a request. A chain with an
> endpoint specifying one argument will only match if exactly one argument
> exists in the path.
>
> You can specify an exact number of arguments like :Args(3), including 0.
> If you just say :Args without any arguments, it is the same as leaving
> it out altogether: The chain is matched regardless of the number of path
> parts after the endpoint.
>
>
>
Yeah, but I think the ticket is asking if there is a way to do a *range*...
IOW, 1 - 3 args... not 0 and not 4 or more. That isn't supported, right?

Thanks again,
Kennedy


>
> --
> Kiffin Gish <Kiffin.Gish [at] planet>
> Gouda, The Netherlands
>
>
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev [at] lists
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>


hkclark at gmail

Nov 18, 2009, 7:43 PM

Post #6 of 8 (2413 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

On Sun, Nov 15, 2009 at 2:29 PM, Kieren Diment <diment [at] gmail> wrote:

>
> On 16/11/2009, at 1:48 AM, hkclark [at] gmail wrote:
>
> Hi Everyone,
>>
>> I have been working on resolving various Catalyst::Manual tickets and
>> getting a long-overdue release of the manual & tutorial out. I wanted to
>> get some input on a few of the tickets if i could:
>>
>> 1) #47363: Remove References to Old/New Ways of Doing Things
>> http://rt.cpan.org/Public/Bug/Display.html?id=47363
>>
>> I took a look at some of these but I wasn't sure if I should start
>> changing
>> things or not. It seems that every time I don't cover variation people
>> might run into if they aren't on the latest/recommended versions, then
>> they
>> get "stuck" and frustrated. I agree that the "Note that if you are using
>> version XX of XX you ..." stuff can be distracting, but it seems like a
>> necessary evil (unless the issue is *really* old... I do try to eventually
>> prune those out). Thoughts?
>>
>>
>
> I agree with Kiffin. Ideally there would be an appendix with some of the
> more relevant ways of dealing with things listed in there.
>
>
>
>> 2) #31164: Catalyst::Manual::Cookbook mod_perl configuration incorrect?
>> http://rt.cpan.org/Public/Bug/Display.html?id=31164
>>
>
> One of the problems with mod_perl is that its sufficiently big and complex
> enough that it's not trivial to have a spare mod_perl server lying around.
> Maybe someone who has one anyway can confirm this
>
>
Let me know if anyone has a setup where they can test this.


>
>> I'm not really a mod_perl user. Can anyone confirm if these changes are
>> correct? Here is the patch:
>>
>> --- catalyst_manual_cookbook.pod.orig 2007-12-03 12:15:11.000000000 +0000
>> +++ catalyst_manual_cookbook.pod 2007-12-03 12:16:05.000000000 +0000
>> @@ -1483,8 +1483,10 @@
>> when run within mod_perl. This makes the configuration extremely easy.
>> Here is a basic Apache 2 configuration.
>>
>> - PerlSwitches -I/var/www/MyApp/lib
>> - PerlModule MyApp
>> + <Perl>
>> + use lib '/var/www/MyApp/lib';
>> + use MyApp;
>> + </Perl>
>>
>> <Location />
>> SetHandler modperl
>>
>> 3) #50953: missing information: action with various args numbers
>> http://rt.cpan.org/Public/Bug/Display.html?id=50953
>>
>> User asks "what If I want to accept with 0, 1 or 2 but not anymore
>> arguments
>> than that?"... my understanding is that you can specify an exact number of
>> :Args or omit it for any number, but not do a range of acceptable args.
>> Can
>> anyone confirm if this is correct?
>>
>>
> You can only have varying URL Args for things at the end of the chain, kind
> of by definition, so this is the :Args [nothing] use case. Then you'd need
> to check length of the $c->req->args array ref manually in your controller
> if you only wanted a certain range of trailing args.
>
>
OK, makes sense. Do we want to document this, or just close the bug as "not
directly supported?" (I vote for the later).

Thanks,
Kennedy


>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev [at] lists
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>


diment at gmail

Nov 18, 2009, 7:49 PM

Post #7 of 8 (2416 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

On 19/11/2009, at 2:43 PM, hkclark [at] gmail wrote:

>> You can only have varying URL Args for things at the end of the
>> chain, kind
>> of by definition, so this is the :Args [nothing] use case. Then
>> you'd need
>> to check length of the $c->req->args array ref manually in your
>> controller
>> if you only wanted a certain range of trailing args.
>>
>>
> OK, makes sense. Do we want to document this, or just close the bug
> as "not
> directly supported?" (I vote for the later).

Not directly supported is good.

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


bobtfish at bobtfish

Nov 19, 2009, 1:54 AM

Post #8 of 8 (2408 views)
Permalink
Re: Catalyst::Manual Questions For The Group [In reply to]

On 15 Nov 2009, at 14:48, hkclark [at] gmail wrote:
> 1) #47363: Remove References to Old/New Ways of Doing Things
> http://rt.cpan.org/Public/Bug/Display.html?id=47363
>
> I took a look at some of these but I wasn't sure if I should start
> changing things or not. It seems that every time I don't cover
> variation people might run into if they aren't on the latest/
> recommended versions, then they get "stuck" and frustrated. I agree
> that the "Note that if you are using version XX of XX you ..." stuff
> can be distracting, but it seems like a necessary evil (unless the
> issue is *really* old... I do try to eventually prune those out).
> Thoughts?

Agreed.

Whilst on this note, I just remembered - we changed the session plugin
configuration keys recently, this is now 'Plugin::Session' rather than
'session' - I guess that

> 2) #31164: Catalyst::Manual::Cookbook mod_perl configuration
> incorrect?
> http://rt.cpan.org/Public/Bug/Display.html?id=31164
>
> I'm not really a mod_perl user. Can anyone confirm if these changes
> are correct? Here is the patch:

The latter form will certainly work, and is what I tend to use.

> 3) #50953: missing information: action with various args numbers
<snip>
> Can anyone confirm if this is correct?

Yes.

Cheers
t0m

P.S. Sorry, this fell in my draughts folder, just rescued it..

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.