Added:
trunk/CPAN/MooseX-Dumper/
trunk/CPAN/MooseX-Dumper/Changes
trunk/CPAN/MooseX-Dumper/Makefile.PL
trunk/CPAN/MooseX-Dumper/README
trunk/CPAN/MooseX-Dumper/lib/
trunk/CPAN/MooseX-Dumper/lib/MooseX/
trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/
trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper.pm
trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/
trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/HTML.pm
trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/Perltidy.pm
trunk/CPAN/MooseX-Dumper/t/
trunk/CPAN/MooseX-Dumper/t/00-load.t
trunk/CPAN/MooseX-Dumper/t/01-basic.t
trunk/CPAN/MooseX-Dumper/t/02-roles-perltidy.t
trunk/CPAN/MooseX-Dumper/t/03-roles-html.t
trunk/CPAN/MooseX-Dumper/t/pod.t
Log:
add MooseX-Dumper
Added: trunk/CPAN/MooseX-Dumper/Changes
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/Changes Sun Feb 22 19:13:45 2009
@@ -0,0 +1,5 @@
+Revision history for MooseX-Dumper
+
+0.01 Date/time
+ First version, released on an unsuspecting world.
+
Added: trunk/CPAN/MooseX-Dumper/Makefile.PL
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/Makefile.PL Sun Feb 22 19:13:45 2009
@@ -0,0 +1,19 @@
+use inc::Module::Install;
+
+name 'MooseX-Dumper';
+all_from 'lib/MooseX/Dumper.pm';
+author 'Fayland Lam <fay...@gmail.com>';
+license 'perl5';
+
+requires 'Moose' => '0.70';
+requires 'MooseX::Traits';
+requires 'Data::Dumper';
+requires 'Perl::Tidy';
+requires 'Text::InHTML';
+
+build_requires 'Test::More';
+
+auto_install;
+
+WriteAll;
+
Added: trunk/CPAN/MooseX-Dumper/README
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/README Sun Feb 22 19:13:45 2009
@@ -0,0 +1,51 @@
+MooseX-Dumper
+
+The README is used to introduce the module and provide instructions on
+how to install the module, any machine dependencies it may have (for
+example C compilers and installed libraries) and any other information
+that should be provided before the module is installed.
+
+A README file is required for CPAN modules since CPAN extracts the README
+file from a module distribution so that people browsing the archive
+can use it to get an idea of the module's uses. It is usually a good idea
+to provide version information here so that people can decide whether
+fixes for the module are worth downloading.
+
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+ perldoc MooseX::Dumper
+
+You can also look for information at:
+
+ RT, CPAN's request tracker
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Dumper
+
+ AnnoCPAN, Annotated CPAN documentation
+ http://annocpan.org/dist/MooseX-Dumper
+
+ CPAN Ratings
+ http://cpanratings.perl.org/d/MooseX-Dumper
+
+ Search CPAN
+ http://search.cpan.org/dist/MooseX-Dumper/
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2009 Fayland Lam
+
+This program is released under the following license: perl5
+
Added: trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper.pm
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper.pm Sun Feb 22 19:13:45 2009
@@ -0,0 +1,58 @@
+package MooseX::Dumper;
+
+use Moose;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:FAYLAND';
+
+with 'MooseX::Traits';
+has '+_trait_namespace' => ( default => 'MooseX::Dumper::Roles' );
+
+has 'dumper_class' => (
+ is => 'rw',
+ isa => 'Str',
+ default => sub { 'Data::Dumper' },
+);
+
+sub Dumper {
+ my $self = shift;
+
+ unless ( Class::MOP::is_class_loaded( $self->dumper_class ) ) {
+ Class::MOP::load_class( $self->dumper_class );
+ $self->dumper_class->import('Dumper');
+ }
+
+ return Dumper(@_);
+}
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
+1;
+__END__
+
+=head1 NAME
+
+MooseX::Dumper - Dumper with roles
+
+=head1 SYNOPSIS
+
+ use MooseX::Dumper;
+
+ my $dumper = MooseX::Dumper->new_with_traits( traits =>
['Perltidy', 'HTML'] );
+ print $dumper->Dumper(\$hash, \@array);
+
+=head1 DESCRIPTION
+
+
+
+=head1 AUTHOR
+
+Fayland Lam, C<< <fayland at gmail.com> >>
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2009 Fayland Lam, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
Added: trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/HTML.pm
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/HTML.pm Sun Feb 22
19:13:45 2009
@@ -0,0 +1,52 @@
+package MooseX::Dumper::Roles::HTML;
+
+use Moose::Role;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:FAYLAND';
+
+around 'Dumper' => sub {
+ my $next = shift;
+
+ my $dumper = $next->(@_);
+
+ require Text::InHTML;
+ my $html = Text::InHTML::encode_plain($dumper);
+
+ return $html;
+};
+
+no Moose::Role;
+
+1;
+__END__
+
+=head1 NAME
+
+MooseX::Dumper::Roles::HTML - MooseX::Dumper with HTML
+
+=head1 SYNOPSIS
+
+ use MooseX::Dumper;
+
+ my $dumper = MooseX::Dumper->new_with_traits( traits => ['HTML'] );
+ print $dumper->Dumper(\$hash, \@array);
+
+=head1 DESCRIPTION
+
+The code are mostly copied from Data::Dumper::HTML
+
+=head1 SEE ALSO
+
+L<Data::Dumper::HTML>
+
+=head1 AUTHOR
+
+Fayland Lam, C<< <fayland at gmail.com> >>
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2009 Fayland Lam, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
\ No newline at end of file
Added: trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/Perltidy.pm
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/lib/MooseX/Dumper/Roles/Perltidy.pm Sun Feb 22
19:13:45 2009
@@ -0,0 +1,53 @@
+package MooseX::Dumper::Roles::Perltidy;
+
+use Moose::Role;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:FAYLAND';
+
+around 'Dumper' => sub {
+ my $next = shift;
+
+ my $dumper = $next->(@_);
+ my $tidied;
+
+ require Perl::Tidy;
+ Perl::Tidy::perltidy( source => \$dumper, destination => \$tidied );
+
+ return $tidied;
+};
+
+no Moose::Role;
+
+1;
+__END__
+
+=head1 NAME
+
+MooseX::Dumper::Roles::Perltidy - MooseX::Dumper with Perltidy
+
+=head1 SYNOPSIS
+
+ use MooseX::Dumper;
+
+ my $dumper = MooseX::Dumper->new_with_traits( traits => ['Perltidy'] );
+ print $dumper->Dumper(\$hash, \@array);
+
+=head1 DESCRIPTION
+
+The code are mostly copied from Data::Dumper::Perltidy
+
+=head1 SEE ALSO
+
+L<Data::Dumper::Perltidy>
+
+=head1 AUTHOR
+
+Fayland Lam, C<< <fayland at gmail.com> >>
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2009 Fayland Lam, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
\ No newline at end of file
Added: trunk/CPAN/MooseX-Dumper/t/00-load.t
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/t/00-load.t Sun Feb 22 19:13:45 2009
@@ -0,0 +1,9 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok( 'MooseX::Dumper' );
+}
+
+diag( "Testing MooseX::Dumper $MooseX::Dumper::VERSION, Perl $], $^X" );
Added: trunk/CPAN/MooseX-Dumper/t/01-basic.t
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/t/01-basic.t Sun Feb 22 19:13:45 2009
@@ -0,0 +1,20 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+use MooseX::Dumper;
+
+my $dumper = MooseX::Dumper->new();
+
+my $hash = { a => 1, b => 3 };
+
+my $ret = $dumper->Dumper(\$hash);
+
+is $ret, <<'EOF';
+$VAR1 = \{
+ 'a' => 1,
+ 'b' => 3
+ };
+EOF
+
+1;
\ No newline at end of file
Added: trunk/CPAN/MooseX-Dumper/t/02-roles-perltidy.t
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/t/02-roles-perltidy.t Sun Feb 22 19:13:45 2009
@@ -0,0 +1,20 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+use MooseX::Dumper;
+
+my $dumper = MooseX::Dumper->new_with_traits( traits => ['Perltidy']);
+
+my $hash = { a => 1, b => 3 };
+
+my $ret = $dumper->Dumper(\$hash);
+
+is $ret, <<'EOF';
+$VAR1 = \{
+ 'a' => 1,
+ 'b' => 3
+};
+EOF
+
+1;
\ No newline at end of file
Added: trunk/CPAN/MooseX-Dumper/t/03-roles-html.t
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/t/03-roles-html.t Sun Feb 22 19:13:45 2009
@@ -0,0 +1,20 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+use MooseX::Dumper;
+
+my $dumper = MooseX::Dumper->new_with_traits( traits => ['HTML']);
+
+my $hash = { a => 1, b => 3 };
+
+my $ret = $dumper->Dumper(\$hash);
+
+is $ret, <<'EOF';
+$VAR1 = \{<br />
+ 'a' => 1,<br />
+ 'b' => 3<br />
+ };<br />
+EOF
+
+1;
\ No newline at end of file
Added: trunk/CPAN/MooseX-Dumper/t/pod.t
==============================================================================
--- (empty file)
+++ trunk/CPAN/MooseX-Dumper/t/pod.t Sun Feb 22 19:13:45 2009
@@ -0,0 +1,12 @@
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod
+my $min_tp = 1.22;
+eval "use Test::Pod $min_tp";
+plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
+
+all_pod_files_ok();