[dancer-users] Re : Dancer->VERSION comparison issue

Celogeek me at celogeek.com
Fri Dec 28 17:39:08 GMT 2012


do you have a link for this perfect dancer plugin example ? I can't find it 


----- Mail original -----

De: "Celogeek" <me at celogeek.com> 
À: "Perl Dancer users mailing list" <dancer-users at dancer.pm> 
Cc: "Dancer Mailing List" <dancer-users at perldancer.org> 
Envoyé: Vendredi 28 Décembre 2012 18:26:30 
Objet: Re: [dancer-users] Re : Dancer->VERSION comparison issue 

Oh thanks. I check that. 


----- Mail original -----

De: "Damien Krotkine" <dkrotkine at gmail.com> 
À: "Perl Dancer users mailing list" <dancer-users at dancer.pm> 
Cc: "Dancer Mailing List" <dancer-users at perldancer.org> 
Envoyé: Vendredi 28 Décembre 2012 18:10:31 
Objet: [dancer-users] Re : Dancer->VERSION comparison issue 

Hi, 

We are going to change dancer_version to return always a numerical value. Should be done very quickly. 

But your problem can be fixed easily by using plugin_args ( I think, can't check right now). It exists in dancer 1 and 2, and handles the dsl as first arg. In dancer 1 it returns undef instead of the dsl. See Dancer::Plugin::Altered on guthub for an example. It's also a good example of a plugin with tests that works on both dancer versions. 


Le vendredi 28 décembre 2012 à 16:08, Celogeek a écrit : 


Hi, I'm still working on upgrading Dancer::Plugin::Redis. 

And the think I have seen and missing in all module I have look and say compatible with dancer2 is that the 'register' pass 'DSL' as a first args ! 

so I need to be backward compatible to do that : 

register redis => sub { 
shift if dancer_version >= 1.99 
... 
} 

But it failed because 1.9999_02 is not numeric ! 

so I use the "ge" but it is not very great. 


_______________________________________________ 
dancer-users mailing list 
dancer-users at dancer.pm 
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users 





_______________________________________________ 
dancer-users mailing list 
dancer-users at dancer.pm 
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users 


_______________________________________________ 
dancer-users mailing list 
dancer-users at dancer.pm 
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20121228/f14d00fe/attachment-0002.htm>


More information about the dancer-users mailing list