[dancer-users] Re : Dancer->VERSION comparison issue
Celogeek
me at celogeek.com
Fri Dec 28 17:26:30 GMT 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20121228/68ca3952/attachment-0003.htm>
More information about the dancer-users
mailing list