From: Yanick Champoux Date: Wed, 1 Dec 2010 02:42:04 +0000 (-0500) Subject: Build results of 0db120e (on www-sitemap-xml) X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-Catalyst-Plugin-Sitemap;a=commitdiff_plain;h=639030276b68892e684b816e90e9df1f23ce7aac Build results of 0db120e (on www-sitemap-xml) --- 639030276b68892e684b816e90e9df1f23ce7aac diff --cc Build.PL index 00dbc32,0000000..41817dd mode 100644,000000..100644 --- a/Build.PL +++ b/Build.PL @@@ -1,44 -1,0 +1,44 @@@ + +use strict; +use warnings; + +use Module::Build 0.3601; + + +my %module_build_args = ( + 'build_requires' => { + 'Carp' => '0', + 'Catalyst' => '0', + 'Catalyst::Controller' => '0', + 'Catalyst::Test' => '0', + 'Module::Build' => '0.3601', + 'Scalar::Util' => '0', + 'Test::More' => '0.94', + 'parent' => '0', + 'perl' => '5.004' + }, + 'configure_requires' => { + 'Module::Build' => '0.3601' + }, + 'dist_abstract' => 'Sitemap support for Catalyst.', + 'dist_author' => [ + 'Yanick Champoux ' + ], + 'dist_name' => 'Catalyst-Plugin-Sitemap', - 'dist_version' => '0.0.1', ++ 'dist_version' => '1.0.0', + 'license' => 'perl', + 'module_name' => 'Catalyst::Plugin::Sitemap', + 'recommends' => {}, + 'recursive_test_files' => 1, + 'requires' => { + 'List::Util' => '0', + 'Moose::Role' => '0', - 'Search::Sitemap' => '0' ++ 'WWW::Sitemap::XML' => '0' + }, + 'script_files' => [] +); + + +my $build = Module::Build->new(%module_build_args); + +$build->create_build_script; diff --cc Changes index 231a297,cfa151d..50fa6d2 --- a/Changes +++ b/Changes @@@ -1,4 -1,10 +1,8 @@@ Revision history for Catalyst-Plugin-Sitemap -{{$NEXT}} - + 1.0.0 2010-11-30 21:41:34 America/Montreal + - Change sitemap object under the hood to WWW::Sitemap::XML. + - Add Dancer::Plugin::SiteMap in the 'SEE ALSO' section. + 0.0.1 2010-09-29 20:19:12 America/Montreal - original version unleashed on an unsuspecting world diff --cc META.json index 68b84c2,0000000..3f036fe mode 100644,000000..100644 --- a/META.json +++ b/META.json @@@ -1,68 -1,0 +1,68 @@@ +{ + "abstract" : "Sitemap support for Catalyst.", + "author" : [ + "Yanick Champoux " + ], + "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101590", ++ "generated_by" : "Dist::Zilla version 4.102345, CPAN::Meta::Converter version 2.101590", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Catalyst-Plugin-Sitemap", + "prereqs" : { + "build" : { + "requires" : { + "Module::Build" : "0.3601" + } + }, + "configure" : { + "requires" : { + "Module::Build" : "0.3601" + } + }, + "runtime" : { + "requires" : { + "List::Util" : 0, + "Moose::Role" : 0, - "Search::Sitemap" : 0 ++ "WWW::Sitemap::XML" : 0 + } + }, + "test" : { + "requires" : { + "Carp" : 0, + "Catalyst" : 0, + "Catalyst::Controller" : 0, + "Catalyst::Test" : 0, + "Scalar::Util" : 0, + "Test::More" : "0.94", + "parent" : 0, + "perl" : "5.004" + } + } + }, + "provides" : { + "Catalyst::Plugin::Sitemap" : { + "file" : "lib/Catalyst/Plugin/Sitemap.pm", - "version" : "v0.0.1" ++ "version" : "v1.0.0" + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "mailto" : "bug-catalyst-plugin-sitemap at rt.cpan.org", + "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-Sitemap" + }, + "homepage" : "http://search.cpan.org/dist/Catalyst-Plugin-Sitemap/", + "repository" : { + "type" : "git", + "url" : "git://github.com/yanick/Catalyst-Plugin-Sitemap.git", + "web" : "http://github.com/yanick/Catalyst-Plugin-Sitemap/tree" + } + }, - "version" : "0.0.1" ++ "version" : "1.0.0" +} + diff --cc META.yml index 5cb1a5e,0000000..225658e mode 100644,000000..100644 --- a/META.yml +++ b/META.yml @@@ -1,36 -1,0 +1,36 @@@ +--- +abstract: 'Sitemap support for Catalyst.' +author: + - 'Yanick Champoux ' +build_requires: + Carp: 0 + Catalyst: 0 + Catalyst::Controller: 0 + Catalyst::Test: 0 + Module::Build: 0.3601 + Scalar::Util: 0 + Test::More: 0.94 + parent: 0 + perl: 5.004 +configure_requires: + Module::Build: 0.3601 +dynamic_config: 0 - generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101590' ++generated_by: 'Dist::Zilla version 4.102345, CPAN::Meta::Converter version 2.101590' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Catalyst-Plugin-Sitemap +provides: + Catalyst::Plugin::Sitemap: + file: lib/Catalyst/Plugin/Sitemap.pm - version: v0.0.1 ++ version: v1.0.0 +requires: + List::Util: 0 + Moose::Role: 0 - Search::Sitemap: 0 ++ WWW::Sitemap::XML: 0 +resources: + bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-Sitemap + homepage: http://search.cpan.org/dist/Catalyst-Plugin-Sitemap/ + repository: git://github.com/yanick/Catalyst-Plugin-Sitemap.git - version: 0.0.1 ++version: 1.0.0 diff --cc SIGNATURE index 25fc168,0000000..ee9b349 mode 100644,000000..100644 --- a/SIGNATURE +++ b/SIGNATURE @@@ -1,34 -1,0 +1,34 @@@ +This file contains message digests of all files listed in MANIFEST, +signed via the Module::Signature module, version 0.64. + +To verify the content in this distribution, first make sure you have +Module::Signature installed, then type: + + % cpansign -v + +It will check each file's integrity, as well as the signature's +validity. If "==> Signature verified OK! <==" is not displayed, +the distribution may already have been compromised, and you should +not run its Makefile.PL or Build.PL. + +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + - SHA1 6e9257c1f0d56e7477a6c3dd0a89aa12da99ee34 Build.PL - SHA1 6c29f09fb70d3a649beeeba49c327c508b8d3f21 Changes ++SHA1 ec9d7233b92322084ff257368adcd37e8f392c4f Build.PL ++SHA1 a5008ab99697e794fd04d95f623e7862990bb888 Changes +SHA1 3ee0d276167c367325eebe1d5ec9877ade504d93 LICENSE +SHA1 27dbcf2e21d25049bc4486395d18d7550732f2d3 MANIFEST - SHA1 39b94a4484567596f4e466bc82f30785018cd502 META.json - SHA1 2376cd5a83bdb52d9400ece68d4d7c5d4c7376e7 META.yml - SHA1 659d2f7059534127e8b98ce9b276fec2be7a02a8 lib/Catalyst/Plugin/Sitemap.pm ++SHA1 abde2a3863a49bfec78410e7371c8196f4cef1ac META.json ++SHA1 7362ebdd1d8b2b1085bd8ead8ba7c574de7bc22b META.yml ++SHA1 9d90ff124e267a7a5f7968bad9197ea89d919fe4 lib/Catalyst/Plugin/Sitemap.pm +SHA1 050aa113e828a52db3c86065c0c0ed50198b7ce8 t/000-report-versions.t +SHA1 bcc4b2250ff00f7dfad036512681c9ee57b9cf5a t/lib/TestApp.pm - SHA1 f2cb7af81edd193cac613e42116d29215e4d2e58 t/lib/TestApp/Controller/Root.pm - SHA1 a3bbccffc4212a277329be0055742310bfd4eebb t/sitemap.t ++SHA1 7906b6e31e1e56c59cc970c66332f56cd41635ec t/lib/TestApp/Controller/Root.pm ++SHA1 67c7e4f0af7ea5454b0f33fb971675f2be5eb973 t/sitemap.t +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + - iEYEARECAAYFAkyj14cACgkQ34Hwf+GwC4zEfQCg9EWt7+v9hzOQnvTansbtqmUx - xCAAn32842Ivd3MNl3ek05Jq239wv+Fg - =ct87 ++iEYEARECAAYFAkz1teUACgkQ34Hwf+GwC4yskQCdHR3zsy//6fNlszKwS+aF1NxO ++lnUAoOaZJ1iW9BZYtNPWsgr+/ALcUm5L ++=CqLE +-----END PGP SIGNATURE----- diff --cc lib/Catalyst/Plugin/Sitemap.pm index 4730f20,e4a906c..7b17271 --- a/lib/Catalyst/Plugin/Sitemap.pm +++ b/lib/Catalyst/Plugin/Sitemap.pm @@@ -1,88 -1,7 +1,98 @@@ package Catalyst::Plugin::Sitemap; +BEGIN { - $Catalyst::Plugin::Sitemap::VERSION = '0.0.1'; ++ $Catalyst::Plugin::Sitemap::VERSION = '1.0.0'; +} + # ABSTRACT: Sitemap support for Catalyst. + +use strict; +use warnings; + +use Moose::Role; + +no warnings qw/uninitialized/; + - use Search::Sitemap; ++use WWW::Sitemap::XML; +use List::Util qw/ first /; + - sub sitemap { ++has sitemap => ( ++ is => 'ro', ++ builder => '_build_sitemap', ++ lazy => 1, ++); ++ ++sub sitemap_as_xml { ++ my $self = shift; ++ return $self->sitemap->as_xml->toString; ++} ++ ++sub _build_sitemap { + my $self = shift; + - my $sitemap = Search::Sitemap->new; - $sitemap->pretty(1); ++ my $sitemap = WWW::Sitemap::XML->new; + - for my $controller ( $self->controller(qr//) ) { ++ for my $controller ( map { $self->controller($_) } $self->controllers ) { + ACTION: + for my $a ( $controller->get_action_methods ) { + + my $action = $controller->action_for( $a->name ); + + my $attr = $action->attributes->{Sitemap} or next ACTION; + + die "more than one attribute 'Sitemap' for sub ", + $a->fully_qualified_name + if @$attr > 1; + + my @attr = split /\s*(?:,|=>)\s*/, $attr->[0]; + + my %uri_params; + + if ( @attr == 1 ) { + if ( $attr[0] eq '*' ) { + my $sitemap_method = $action->name . "_sitemap"; + + if ( $controller->can($sitemap_method) ) { + $controller->$sitemap_method( $self, $sitemap ); + next ACTION; + } + } + + if ( $attr[0] + 0 > 0 ) { ++ + # it's a number + $uri_params{priority} = $attr[0]; + } + + } + elsif ( @attr > 0 ) { + %uri_params = @attr; + } + + $uri_params{loc} = $self->uri_for_action( $action->private_path ); + - $sitemap->add( \%uri_params ); - - next ACTION; ++ $sitemap->add(%uri_params); + } + + } + + return $sitemap; +} + +1; + + + +=pod + +=head1 NAME + +Catalyst::Plugin::Sitemap - Sitemap support for Catalyst. + +=head1 VERSION + - version 0.0.1 ++version 1.0.0 + =head1 SYNOPSIS # in MyApp.pm @@@ -193,35 -118,106 +208,41 @@@ resolving to many urls =back - =head1 BUGS AND LIMITATIONS - - Currently, each invocation of the method C will - re-generate the C object. A future version - of this module might offer a way to only compute the sitemap - once. -- =head1 SEE ALSO -=over +=over + =item L + + Module that C currently uses under the hood. + =item L + Original module that this plugin was using under the hood. + - + =item L + + Similar plugin for the L framework, which inspired + C. + =item http://babyl.dyndns.org/techblog/entry/catalyst-plugin-sitemap + Blog article introducing C. + =back -=cut - -use strict; -use warnings; - -use Moose::Role; - -no warnings qw/uninitialized/; - -use WWW::Sitemap::XML; -use List::Util qw/ first /; - -has sitemap => ( - is => 'ro', - builder => '_build_sitemap', - lazy => 1, -); - -sub sitemap_as_xml { - my $self = shift; - return $self->sitemap->as_xml->toString; -} +=head1 AUTHOR - Yanick Champoux -sub _build_sitemap { - my $self = shift; ++Yanick Champoux - my $sitemap = WWW::Sitemap::XML->new; - - for my $controller ( map { $self->controller($_) } $self->controllers ) { - ACTION: - for my $a ( $controller->get_action_methods ) { +=head1 COPYRIGHT AND LICENSE - my $action = $controller->action_for( $a->name ); +This software is copyright (c) 2010 by Yanick Champoux. - my $attr = $action->attributes->{Sitemap} or next ACTION; +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. - die "more than one attribute 'Sitemap' for sub ", - $a->fully_qualified_name - if @$attr > 1; - - my @attr = split /\s*(?:,|=>)\s*/, $attr->[0]; - - my %uri_params; - - if ( @attr == 1 ) { - if ( $attr[0] eq '*' ) { - my $sitemap_method = $action->name . "_sitemap"; - - if ( $controller->can($sitemap_method) ) { - $controller->$sitemap_method( $self, $sitemap ); - next ACTION; - } - } - - if ( $attr[0] + 0 > 0 ) { - - # it's a number - $uri_params{priority} = $attr[0]; - } - - } - elsif ( @attr > 0 ) { - %uri_params = @attr; - } - - $uri_params{loc} = $self->uri_for_action( $action->private_path ); - - $sitemap->add(%uri_params); - } - - } - - return $sitemap; -} +=cut -1; __END__