Permalink
Browse files

Sort config and environment dumps.

Don't lazily say "Values of 1 sensitive-looking keys hidden".
  • Loading branch information...
1 parent 4b69024 commit dff72278d69aadb49d5653cdced186e57ef3545b @skington skington committed with xsawyerx Mar 4, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Dancer/Error.pm
View
@@ -124,12 +124,14 @@ sub dumper {
#use Data::Dumper;
my $dd = Data::Dumper->new([\%data]);
- $dd->Terse(1)->Quotekeys(0)->Indent(1);
+ $dd->Terse(1)->Quotekeys(0)->Indent(1)->Sortkeys(1);
my $content = $dd->Dump();
$content =~ s{(\s*)(\S+)(\s*)=>}{$1<span class="key">$2</span>$3 =&gt;}g;
if ($censored) {
$content
- .= "\n\nNote: Values of $censored sensitive-looking keys hidden\n";
+ .= "\n\nNote: Values of $censored sensitive-looking key"
+ . ($censored == 1 ? '' : 's')
+ . " hidden\n";
}
return $content;
}

0 comments on commit dff7227

Please sign in to comment.