Permalink
Browse files

add config file for Data::Printer

  • Loading branch information...
gray committed Nov 17, 2012
1 parent 25f3227 commit ac74ca57f4baee7409edcfd66bd845b260ed7007
Showing with 38 additions and 1 deletion.
  1. +37 −0 .dataprinter
  2. +1 −1 .vim/filetype.vim
View
@@ -0,0 +1,37 @@
+my $conf = {
+ hash_separator => ' => ',
+ deparse => 1,
+ show_readonly => 1,
+ print_escapes => 1,
+ caller_info => 1,
+ class => {
+ parents => 0,
+ show_methods => 'none',
+ },
+
+ filters => {
+ -external => [qw( DB DateTime )],
+ 'HTTP::Request' => sub {
+ my ($req, $p) = @_;
+ $p->{class}{expand} = 'all';
+ return;
+ },
+ 'HTTP::Response' => sub {
+ my ($res, $p) = @_;
+ return if exists $res->{decoded_content};
+ $p->{class}{expand} = 'all';
+
+ my $clone = $res->clone;
+ my $decoded_content = $clone->decoded_content;
+ if ($decoded_content ne $clone->content) {
+ $clone->{decoded_content} = $decoded_content;
+ $clone->content('Content is encoded- see decoded_content');
+ return p($clone, %$p);
+ }
+ return;
+ },
+ },
+ datetime => {
+ show_class_name => 1,
+ },
+};
View
@@ -12,7 +12,7 @@ autocmd BufNewFile,BufRead *.epub setfiletype epub
autocmd BufNewFile,BufRead hg-editor-*.txt setfiletype hgcommit
autocmd BufNewFile,BufRead *.json setfiletype javascript
autocmd BufNewFile,BufRead *.nfo setfiletype nfo
-autocmd BufNewFile,BufRead *.psgi setfiletype perl
+autocmd BufNewFile,BufRead *.psgi,~/.dataprinter setfiletype perl
autocmd BufNewFile,BufRead *.scala setfiletype scala
autocmd BufNewFile,BufRead .bash_* call SetFileTypeSH('bash')
autocmd BufNewFile,BufRead bash-fc-\d\+ call SetFileTypeSH('bash')

0 comments on commit ac74ca5

Please sign in to comment.