[Catalyst-commits] r6226 - in trunk/Catalyst-Model-S3: . examples
lib/Catalyst/Helper/Model lib/Catalyst/Model t t/lib
davecardwell at dev.catalyst.perl.org
davecardwell at dev.catalyst.perl.org
Wed Mar 28 22:31:35 GMT 2007
Author: davecardwell
Date: 2007-03-28 22:31:34 +0100 (Wed, 28 Mar 2007)
New Revision: 6226
Added:
trunk/Catalyst-Model-S3/examples/
trunk/Catalyst-Model-S3/examples/Model.pm
Modified:
trunk/Catalyst-Model-S3/Build.PL
trunk/Catalyst-Model-S3/Changes
trunk/Catalyst-Model-S3/lib/Catalyst/Helper/Model/S3.pm
trunk/Catalyst-Model-S3/lib/Catalyst/Model/S3.pm
trunk/Catalyst-Model-S3/t/00.load.t
trunk/Catalyst-Model-S3/t/01.functionality.t
trunk/Catalyst-Model-S3/t/02.perlcritic.t
trunk/Catalyst-Model-S3/t/03.pod.t
trunk/Catalyst-Model-S3/t/04.pod-coverage.t
trunk/Catalyst-Model-S3/t/lib/TestApp.pm
Log:
Tidied up distribution:
* Improved documentation
* Tidied up testing
* Fixed dependencies in Makefile.pl
Modified: trunk/Catalyst-Model-S3/Build.PL
===================================================================
--- trunk/Catalyst-Model-S3/Build.PL 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/Build.PL 2007-03-28 21:31:34 UTC (rev 6226)
@@ -4,22 +4,23 @@
use Module::Build;
my $builder = Module::Build->new(
- module_name => 'Catalyst::Model::S3',
- license => 'perl',
- dist_version_from => 'lib/Catalyst/Model/S3.pm',
- create_makefile_pl => 'traditional',
- create_readme => 1,
- requires => {
+ add_to_cleanup => [qw/ Catalyst-Model-S3-*
+ Catalyst-Helper-Model-S3-* /],
+ build_requires => {
+ 'Test::More' => '0',
+ },
+ create_makefile_pl => 'passthrough',
+ create_readme => 1,
+ dist_version_from => 'lib/Catalyst/Model/S3.pm',
+ license => 'perl',
+ module_name => 'Catalyst::Model::S3',
+ requires => {
'Carp' => '0',
- 'Catalyst' => '5.00',
+ 'Catalyst::Model' => '0',
+ 'Catalyst::Utils' => '0',
'Class::C3' => '0',
'Net::Amazon::S3' => '0.31',
},
- build_requires => {
- 'Test::More' => '0',
- },
- add_to_cleanup => [ 'Catalyst-Model-S3-*',
- 'Catalyst-Helper-Model-S3-*' ],
);
$builder->create_build_script();
Modified: trunk/Catalyst-Model-S3/Changes
===================================================================
--- trunk/Catalyst-Model-S3/Changes 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/Changes 2007-03-28 21:31:34 UTC (rev 6226)
@@ -1,4 +1,10 @@
-Revision history for Catalyst-Model-S3
+Revision history for Catalyst::Model::S3
-0.01 2007-03-07:
- Initial release.
+0.02 2007-03-28:
+ Tidied up distribution:
+ * Improved documentation
+ * Tidied up testing
+ * Fixed dependencies in Makefile.pl
+
+0.01 2007-03-07:
+ Initial release.
Added: trunk/Catalyst-Model-S3/examples/Model.pm
===================================================================
--- trunk/Catalyst-Model-S3/examples/Model.pm (rev 0)
+++ trunk/Catalyst-Model-S3/examples/Model.pm 2007-03-28 21:31:34 UTC (rev 6226)
@@ -0,0 +1,13 @@
+package MyApp::Model::S3;
+
+use base qw/ Catalyst::Model::S3 /;
+
+__PACKAGE__->config(
+ aws_access_key_id => 'your_access_key_id',
+ aws_secret_access_key => 'your_secret_access_key',
+ secure => 0, # optional: default 0 (false)
+ timeout => 30, # optional: default 30 (seconds)
+);
+
+
+1;
Modified: trunk/Catalyst-Model-S3/lib/Catalyst/Helper/Model/S3.pm
===================================================================
--- trunk/Catalyst-Model-S3/lib/Catalyst/Helper/Model/S3.pm 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/lib/Catalyst/Helper/Model/S3.pm 2007-03-28 21:31:34 UTC (rev 6226)
@@ -10,7 +10,7 @@
=head1 NAME
-Catalyst::Helper::Model::S3 - Helper for S3 Catalyst Models
+Catalyst::Helper::Model::S3 - Helper for S3 Catalyst models
=head1 SYNOPSIS
@@ -41,7 +41,7 @@
=head2 mk_compclass
-This method takes the given arguments and generates an Catalyst::Model::S3
+This method takes the given arguments and generates a Catalyst::Model::S3
model for your application.
=cut
@@ -121,6 +121,7 @@
Dave Cardwell <dcardwell at cpan.org>
+
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2007 Dave Cardwell. All rights reserved.
Modified: trunk/Catalyst-Model-S3/lib/Catalyst/Model/S3.pm
===================================================================
--- trunk/Catalyst-Model-S3/lib/Catalyst/Model/S3.pm 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/lib/Catalyst/Model/S3.pm 2007-03-28 21:31:34 UTC (rev 6226)
@@ -6,40 +6,40 @@
use base qw/ Catalyst::Model /;
use Carp qw( croak );
-use Catalyst::Utils;
-use Class::C3;
-use Net::Amazon::S3;
+use Catalyst::Utils ();
+use Class::C3 ();
+use Net::Amazon::S3 ();
-our $VERSION = '0.01';
+our $VERSION = '0.02';
=head1 NAME
-Catalyst::Model::S3 - Catalyst Model for Amazon's S3 web service
+Catalyst::Model::S3 - Catalyst model for Amazon's S3 web service
=head1 SYNOPSIS
# Use the helper to add an S3 model to your application...
script/myapp_create.pl create model S3 S3
-
-
+
+
# lib/MyApp/Model/S3.pm
-
+
package MyApp::Model::S3;
-
+
use base qw/ Catalyst::Model::S3 /;
-
+
__PACKAGE__->config(
aws_access_key_id => 'your_access_key_id',
aws_secret_access_key => 'your_secret_access_key',
secure => 0, # optional: default 0 (false)
timeout => 30, # optional: default 30 (seconds)
);
-
+
1;
-
-
+
+
# In a controller...
my $s3 = $c->model('S3');
print ref($s3); # Net::Amazon::S3
@@ -54,9 +54,9 @@
=head1 METHODS
-=head2 new
+=head2 ->new()
-Instantiate a new S3 Model. See
+Instantiate a new L<Net::Amazon::S3> Model. See
L<Net::Amazon::S3's new method|Net::Amazon::S3/new> for the options available.
=cut
@@ -83,7 +83,8 @@
=head2 ACCEPT_CONTEXT
-Return the Net::Amazon::S3 object. Called automatically via $c->model('S3');
+Return the L<Net::Amazon::S3> object. Called automatically via
+C<$c-E<gt>model('S3');>
=cut
@@ -92,6 +93,9 @@
}
+1; # End of the module code; everything from here is documentation...
+__END__
+
=head1 SEE ALSO
L<Catalyst>, L<Catalyst::Helper::Model::S3>, L<Net::Amazon::S3>
@@ -99,16 +103,26 @@
=head1 DEPENDENCIES
-Catalyst::Model::S3 requires the following modules:
-
=over
=item
-L<Catalyst>
+L<Carp>
=item
+L<Catalyst::Model>
+
+=item
+
+L<Catalyst::Utils>
+
+=item
+
+L<Class::C3>
+
+=item
+
L<Net::Amazon::Simple>
=back
@@ -154,6 +168,7 @@
Dave Cardwell <dcardwell at cpan.org>
+
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2007 Dave Cardwell. All rights reserved.
@@ -161,7 +176,5 @@
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. See L<perlartistic>.
+
=cut
-
-
-1;
Modified: trunk/Catalyst-Model-S3/t/00.load.t
===================================================================
--- trunk/Catalyst-Model-S3/t/00.load.t 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/t/00.load.t 2007-03-28 21:31:34 UTC (rev 6226)
@@ -1,7 +1,11 @@
+#!perl -wT
+
+use strict;
+use warnings;
+
use Test::More tests => 1;
-BEGIN {
- use_ok( 'Catalyst::Model::S3' );
-}
+use_ok( 'Catalyst::Model::S3' );
-diag( "Testing Catalyst::Model::S3 $Catalyst::Model::S3::VERSION" );
+diag( 'Testing Catalyst::Model::S3 '
+ . $Catalyst::Model::S3::VERSION );
Modified: trunk/Catalyst-Model-S3/t/01.functionality.t
===================================================================
--- trunk/Catalyst-Model-S3/t/01.functionality.t 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/t/01.functionality.t 2007-03-28 21:31:34 UTC (rev 6226)
@@ -3,21 +3,20 @@
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 3;
use lib qw( t/lib );
-plan tests => 3;
-
-# Make sure the test Catalyst app loads ok...
+# Make sure the Catalyst app loads ok...
use_ok('TestApp');
# Check that the S3 model returns a valid Net::Amazon::S3 object...
my $s3 = TestApp->model('S3');
-isa_ok( $s3, 'Net::Amazon::S3');
+isa_ok( $s3, 'Net::Amazon::S3' );
can_ok( $s3, 'buckets' );
+
# If you've already tested and installed Net::Amazon::S3, there is no reason
# to run tests against the S3 server again.
Modified: trunk/Catalyst-Model-S3/t/02.perlcritic.t
===================================================================
--- trunk/Catalyst-Model-S3/t/02.perlcritic.t 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/t/02.perlcritic.t 2007-03-28 21:31:34 UTC (rev 6226)
@@ -1,9 +1,15 @@
-#!perl
+#!perl -wT
-if (!require Test::Perl::Critic) {
- Test::More::plan(
- skip_all => "Test::Perl::Critic required for testing PBP compliance"
- );
+use strict;
+use warnings;
+
+use Test::More;
+
+
+eval 'use Test::Perl::Critic';
+if ( $@ ) {
+ plan skip_all => 'Test::Perl::Critic required to test for best-practices';
}
-
-Test::Perl::Critic::all_critic_ok();
+else {
+ Test::Perl::Critic::all_critic_ok();
+}
Modified: trunk/Catalyst-Model-S3/t/03.pod.t
===================================================================
--- trunk/Catalyst-Model-S3/t/03.pod.t 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/t/03.pod.t 2007-03-28 21:31:34 UTC (rev 6226)
@@ -1,6 +1,15 @@
-#!perl -T
+#!perl -wT
+use strict;
+use warnings;
+
use Test::More;
-eval "use Test::Pod 1.14";
-plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
-all_pod_files_ok();
+
+
+eval 'use Test::Pod 1.14';
+if ( $@ ) {
+ plan skip_all => 'Test::Pod 1.14 required for testing POD';
+}
+else {
+ Test::Pod::all_pod_files_ok();
+}
Modified: trunk/Catalyst-Model-S3/t/04.pod-coverage.t
===================================================================
--- trunk/Catalyst-Model-S3/t/04.pod-coverage.t 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/t/04.pod-coverage.t 2007-03-28 21:31:34 UTC (rev 6226)
@@ -1,6 +1,15 @@
-#!perl -T
+#!perl -wT
+use strict;
+use warnings;
+
use Test::More;
-eval "use Test::Pod::Coverage 1.04";
-plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
-all_pod_coverage_ok();
+
+
+eval 'use Test::Pod::Coverage 1.04';
+if ( $@ ) {
+ plan skip_all => 'Test::Pod::Coverage 1.04 required for testing POD coverage';
+}
+else {
+ Test::Pod::Coverage::all_pod_coverage_ok();
+}
Modified: trunk/Catalyst-Model-S3/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Model-S3/t/lib/TestApp.pm 2007-03-28 21:25:38 UTC (rev 6225)
+++ trunk/Catalyst-Model-S3/t/lib/TestApp.pm 2007-03-28 21:31:34 UTC (rev 6226)
@@ -10,7 +10,7 @@
'Model::S3' => {
aws_access_key_id => 'fake key',
aws_secret_access_key => 'fake secret'
- }
+ },
);
__PACKAGE__->setup;
More information about the Catalyst-commits
mailing list