-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add localizer; use JSON::MaybeXS; avoid EOL-check for tests #23
base: master
Are you sure you want to change the base?
Conversation
Test pass on qa
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor points but the concept looks fine, thanks.
Don't forget to update the documentation for the new config parameter!
@@ -5,7 +5,7 @@ use warnings; | |||
|
|||
use MojoX::JSON::RPC::Client; | |||
use Guard; | |||
use JSON; | |||
use JSON::MaybeXS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpanfile
needs updating? Although I'd suggest better to use Mojo::JSON
, that way 3rd-party users get consistent handling across Mojolicious code.
@@ -14,6 +14,10 @@ sub register { | |||
|
|||
die 'No base path found!' unless $config->{base_path}; | |||
|
|||
my $localizer = (ref($config->{localizer}) // '?') eq 'CODE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for the //
fallback here, ref
returns an empty string for non-refs/undef. However, I'd suggest better to make it $config->{localizer} || sub { $_[1] }
otherwise it's silently ignoring invalid parameters such as localizer => "some_helper_name"
.
No description provided.