Mailing List Archive

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
Re: Catalyst::Manual Questions For The Group [ In reply to ]
On Sun, 2009-11-15 at 09:48 -0500, hkclark@gmail.com 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@planet.nl>
Gouda, The Netherlands



_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Catalyst::Manual Questions For The Group [ In reply to ]
On 16/11/2009, at 1:48 AM, hkclark@gmail.com 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@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Catalyst::Manual Questions For The Group [ In reply to ]
On Sun, Nov 15, 2009 at 12:29 PM, Kieren Diment <diment@gmail.com> wrote:

>
> On 16/11/2009, at 1:48 AM, hkclark@gmail.com 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@lists.scsys.co.uk
> 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
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@planet.nl> wrote:

> On Sun, 2009-11-15 at 09:48 -0500, hkclark@gmail.com 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@planet.nl>
> Gouda, The Netherlands
>
>
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev@lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>
Re: Catalyst::Manual Questions For The Group [ In reply to ]
On Sun, Nov 15, 2009 at 2:29 PM, Kieren Diment <diment@gmail.com> wrote:

>
> On 16/11/2009, at 1:48 AM, hkclark@gmail.com 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@lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>
Re: Catalyst::Manual Questions For The Group [ In reply to ]
On 19/11/2009, at 2:43 PM, hkclark@gmail.com 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@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Catalyst::Manual Questions For The Group [ In reply to ]
On 15 Nov 2009, at 14:48, hkclark@gmail.com 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@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev