diff -Nru libpod-weaver-section-support-perl-1.012/Build.PL libpod-weaver-section-support-perl-1.013/Build.PL --- libpod-weaver-section-support-perl-1.012/Build.PL 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/Build.PL 2020-02-07 16:32:39.000000000 +0000 @@ -19,7 +19,7 @@ "Shlomi Fish " ], "dist_name" => "Pod-Weaver-Section-Support", - "dist_version" => "1.012", + "dist_version" => "1.013", "license" => "perl", "module_name" => "Pod::Weaver::Section::Support", "recursive_test_files" => 1, diff -Nru libpod-weaver-section-support-perl-1.012/Changes libpod-weaver-section-support-perl-1.013/Changes --- libpod-weaver-section-support-perl-1.012/Changes 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/Changes 2020-02-07 16:32:39.000000000 +0000 @@ -1,5 +1,10 @@ Revision history for Pod::Weaver::Section::Support +1.013 2020-02-07 + - Remove broken links to old resources: + - https://github.com/shlomif/HTML-Spelling-Site/issues/2 + - Thanks to @tobyink . + 1.012 2019-12-28 - Exclude files using MANIFEST.SKIP. - https://github.com/shlomif/perl-pod-weaver-section-support/issues/3 diff -Nru libpod-weaver-section-support-perl-1.012/debian/changelog libpod-weaver-section-support-perl-1.013/debian/changelog --- libpod-weaver-section-support-perl-1.012/debian/changelog 2020-01-07 13:47:46.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/debian/changelog 2020-02-08 12:52:02.000000000 +0000 @@ -1,3 +1,16 @@ +libpod-weaver-section-support-perl (1.013-1) unstable; urgency=medium + + * Team upload. + * Import upstream version 1.013. + * Declare compliance with Debian Policy 4.5.0. + * Set Rules-Requires-Root: no. + * Annotate test-only build dependencies with . + * debian/watch: use uscan version 4. + * Set upstream metadata fields: Bug-Submit, Repository. + * Remove obsolete fields Contact, Name from debian/upstream/metadata. + + -- gregor herrmann Sat, 08 Feb 2020 13:52:02 +0100 + libpod-weaver-section-support-perl (1.012-1) unstable; urgency=medium * New upstream version 1.012 diff -Nru libpod-weaver-section-support-perl-1.012/debian/control libpod-weaver-section-support-perl-1.013/debian/control --- libpod-weaver-section-support-perl-1.012/debian/control 2020-01-07 13:47:46.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/debian/control 2020-02-08 12:52:02.000000000 +0000 @@ -7,13 +7,14 @@ Build-Depends: debhelper-compat (= 12), libmodule-build-perl, perl -Build-Depends-Indep: libmoose-perl, - libpod-weaver-perl, - libppix-documentname-perl -Standards-Version: 4.4.1 +Build-Depends-Indep: libmoose-perl , + libpod-weaver-perl , + libppix-documentname-perl +Standards-Version: 4.5.0 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libpod-weaver-section-support-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libpod-weaver-section-support-perl.git Homepage: https://metacpan.org/release/Pod-Weaver-Section-Support +Rules-Requires-Root: no Package: libpod-weaver-section-support-perl Architecture: all diff -Nru libpod-weaver-section-support-perl-1.012/debian/upstream/metadata libpod-weaver-section-support-perl-1.013/debian/upstream/metadata --- libpod-weaver-section-support-perl-1.012/debian/upstream/metadata 2020-01-07 13:47:46.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/debian/upstream/metadata 2020-02-08 12:52:02.000000000 +0000 @@ -1,7 +1,6 @@ --- Archive: CPAN Bug-Database: https://github.com/shlomif/perl-pod-weaver-section-support/issues -Contact: Shlomi Fish -Name: Pod-Weaver-Section-Support -Repository: https://github.com/shlomif/perl-pod-weaver-section-support +Bug-Submit: https://github.com/shlomif/perl-pod-weaver-section-support/issues/new +Repository: https://github.com/shlomif/perl-pod-weaver-section-support.git Repository-Browse: https://github.com/shlomif/perl-pod-weaver-section-support diff -Nru libpod-weaver-section-support-perl-1.012/debian/watch libpod-weaver-section-support-perl-1.013/debian/watch --- libpod-weaver-section-support-perl-1.012/debian/watch 2020-01-07 13:47:46.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/debian/watch 2020-02-08 12:52:02.000000000 +0000 @@ -1,2 +1,2 @@ -version=3 -https://metacpan.org/release/Pod-Weaver-Section-Support .*/Pod-Weaver-Section-Support-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ +version=4 +https://metacpan.org/release/Pod-Weaver-Section-Support .*/Pod-Weaver-Section-Support-v?@ANY_VERSION@@ARCHIVE_EXT@$ diff -Nru libpod-weaver-section-support-perl-1.012/dist.ini libpod-weaver-section-support-perl-1.013/dist.ini --- libpod-weaver-section-support-perl-1.012/dist.ini 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/dist.ini 2020-02-07 16:32:39.000000000 +0000 @@ -3,7 +3,7 @@ license = Perl_5 copyright_holder = Apocalyptic copyright_year = 2010 -version = 1.012 +version = 1.013 [@Filter] -bundle = @SHLOMIF diff -Nru libpod-weaver-section-support-perl-1.012/lib/Pod/Weaver/Section/Support.pm libpod-weaver-section-support-perl-1.013/lib/Pod/Weaver/Section/Support.pm --- libpod-weaver-section-support-perl-1.012/lib/Pod/Weaver/Section/Support.pm 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/lib/Pod/Weaver/Section/Support.pm 2020-02-07 16:32:39.000000000 +0000 @@ -1,5 +1,5 @@ package Pod::Weaver::Section::Support; -$Pod::Weaver::Section::Support::VERSION = '1.012'; +$Pod::Weaver::Section::Support::VERSION = '1.013'; # ABSTRACT: Add a SUPPORT section to your POD use Moose 1.03; @@ -7,628 +7,790 @@ with 'Pod::Weaver::Role::Section' => { -version => '3.100710' }; -sub mvp_multivalue_args { qw( websites irc bugs_content email_content irc_content repository_content websites_content ) } +sub mvp_multivalue_args +{ + qw( websites irc bugs_content email_content irc_content repository_content websites_content ); +} has all_modules => ( - is => 'ro', - isa => 'Bool', - default => 0, + is => 'ro', + isa => 'Bool', + default => 0, ); has perldoc => ( - is => 'ro', - isa => 'Bool', - default => 1, + is => 'ro', + isa => 'Bool', + default => 1, ); { - use Moose::Util::TypeConstraints 1.01; + use Moose::Util::TypeConstraints 1.01; - has bugs => ( - is => 'ro', - isa => enum( [ qw( rt metadata none ) ] ), - default => 'rt', - ); + has bugs => ( + is => 'ro', + isa => enum( [qw( rt metadata none )] ), + default => 'rt', + ); - no Moose::Util::TypeConstraints; + no Moose::Util::TypeConstraints; } has bugs_content => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { - [ <<'EOPOD', + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { + [ + <<'EOPOD', Please report any bugs or feature requests by email to {EMAIL}, or through the web interface at {WEB}. You will be automatically notified of any progress on the request by the system. EOPOD - ]; - }, + ]; + }, ); # TODO how do I Moosify this into a fancy type system where it coerces from CSV strings and bla bla? has websites => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { [ 'all' ] }, + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { ['all'] }, ); has websites_content => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { - [ <<'EOPOD', + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { + [ + <<'EOPOD', The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. EOPOD - ]; - }, + ]; + }, ); has irc => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { [ ] }, + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { [] }, ); has irc_content => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { - [ <<'EOPOD', + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { + [ + <<'EOPOD', You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is, please read this excellent guide: L. Please be courteous and patient when talking to us, as we might be busy or sleeping! You can join those networks/channels and get help: EOPOD - ]; - }, + ]; + }, ); { - use Moose::Util::TypeConstraints 1.01; + use Moose::Util::TypeConstraints 1.01; - has repository_link => ( - is => 'ro', - isa => enum( [ qw( both none url web ) ] ), - default => 'both', - ); + has repository_link => ( + is => 'ro', + isa => enum( [qw( both none url web )] ), + default => 'both', + ); - no Moose::Util::TypeConstraints; + no Moose::Util::TypeConstraints; } has repository_content => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { - [ <<'EOPOD', + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { + [ + <<'EOPOD', The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) EOPOD - ]; - }, + ]; + }, ); has email => ( - is => 'ro', - isa => 'Maybe[Str]', - default => undef, + is => 'ro', + isa => 'Maybe[Str]', + default => undef, ); has email_content => ( - is => 'ro', - isa => 'ArrayRef[Str]', - default => sub { - [ <<'EOPOD', + is => 'ro', + isa => 'ArrayRef[Str]', + default => sub { + [ + <<'EOPOD', You can email the author of this module at {EMAIL} asking for help with any problems you have. EOPOD - ]; - }, + ]; + }, ); -sub weave_section { - ## no critic ( ProhibitAccessOfPrivateData ) - my ($self, $document, $input) = @_; - - my $zilla = $input->{zilla} or die 'Please use Dist::Zilla with this module!'; - - # Is this the main module POD? - if ( ! $self->all_modules ) { - return if $zilla->main_module->name ne $input->{filename}; - } - - # Add the stopwords so the spell checker won't complain! - # TODO make this smarter so it loads only the stopwords we need for specific sections... ohwell - push @{ $document->children }, Pod::Elemental::Element::Pod5::Region->new( { - format_name => 'stopwords', - is_pod => 1, - content => '', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => join( " ", qw( cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan ) ), - } ), - ], - } ), - Pod::Elemental::Element::Nested->new( { - command => 'head1', - content => 'SUPPORT', - children => [ - $self->_add_perldoc( $input->{ppi_document} ), - $self->_add_websites( $zilla ), - $self->_add_email( $zilla ), - $self->_add_irc( $zilla ), - $self->_add_bugs( $zilla, $input->{'distmeta'} ), - $self->_add_repo( $zilla ), - ], - } ); -} - -sub _add_email { - my $self = shift; - - # Do we have anything to do? - return () if ! defined $self->email; - - # pause id for email? - my $address = $self->email; - if ( $address !~ /\@/ ) { - $address = 'C<' . uc( $address ) . ' at cpan.org>'; - } else { - $address = "C<$address>"; - } - - my $content = join( "\n", @{ $self->email_content } ); - $content =~ s/\{EMAIL\}/$address/; - - return Pod::Elemental::Element::Nested->new( { - command => 'head2', - content => 'Email', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => $content, - } ), - ], - } ); -} - -sub _add_bugs { - my( $self, $zilla, $distmeta ) = @_; - - # Do we have anything to do? - return () if $self->bugs eq 'none'; - - # Which kind of text should we display? - my $text = join( "\n", @{ $self->bugs_content } ); - if ( $self->bugs eq 'rt' ) { - my $dist = $zilla->name; - my $mailto = "C"; - my $web = "L"; - - $text =~ s/\{WEB\}/$web/; - $text =~ s/\{EMAIL\}/$mailto/; - } else { - # code copied from Pod::Weaver::Section::Bugs, thanks RJBS! - $self->log_fatal( 'No bugtracker in metadata!' ) unless exists $distmeta->{resources}{bugtracker}; - my $bugtracker = $distmeta->{resources}{bugtracker}; - my( $web, $mailto ) = @{$bugtracker}{qw/web mailto/}; - $self->log_fatal( 'No bugtracker in metadata!' ) unless defined $web || defined $mailto; - - $text =~ s/\{WEB\}/L\<$web\>/ if defined $web; - $text =~ s/\{EMAIL\}/C\<$mailto\>/ if defined $mailto; - - # sanity check the content - if ( $text =~ /\{WEB\}/ ) { - $self->log_fatal( "The metadata doesn't have a website for the bugtracker but you specified it in the bugs_content!" ); - } - if ( $text =~ /\{EMAIL\}/ ) { - $self->log_fatal( "The metadata doesn't have an email for the bugtracker but you specified it in the bugs_content!" ); - } - } - - return Pod::Elemental::Element::Nested->new( { - command => 'head2', - content => 'Bugs / Feature Requests', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => $text, - } ), - ], - } ); +sub weave_section +{ + ## no critic ( ProhibitAccessOfPrivateData ) + my ( $self, $document, $input ) = @_; + + my $zilla = $input->{zilla} + or die 'Please use Dist::Zilla with this module!'; + + # Is this the main module POD? + if ( !$self->all_modules ) + { + return if $zilla->main_module->name ne $input->{filename}; + } + +# Add the stopwords so the spell checker won't complain! +# TODO make this smarter so it loads only the stopwords we need for specific sections... ohwell + push @{ $document->children }, + Pod::Elemental::Element::Pod5::Region->new( + { + format_name => 'stopwords', + is_pod => 1, + content => '', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => join( " ", + qw( cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan ) + ), + } + ), + ], + } + ), + Pod::Elemental::Element::Nested->new( + { + command => 'head1', + content => 'SUPPORT', + children => [ + $self->_add_perldoc( $input->{ppi_document} ), + $self->_add_websites($zilla), + $self->_add_email($zilla), + $self->_add_irc($zilla), + $self->_add_bugs( $zilla, $input->{'distmeta'} ), + $self->_add_repo($zilla), + ], + } + ); +} + +sub _add_email +{ + my $self = shift; + + # Do we have anything to do? + return () if !defined $self->email; + + # pause id for email? + my $address = $self->email; + if ( $address !~ /\@/ ) + { + $address = 'C<' . uc($address) . ' at cpan.org>'; + } + else + { + $address = "C<$address>"; + } + + my $content = join( "\n", @{ $self->email_content } ); + $content =~ s/\{EMAIL\}/$address/; + + return Pod::Elemental::Element::Nested->new( + { + command => 'head2', + content => 'Email', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => $content, + } + ), + ], + } + ); } -sub _add_perldoc { - my( $self, $ppi_doc ) = @_; +sub _add_bugs +{ + my ( $self, $zilla, $distmeta ) = @_; - # Do we have anything to do? - return () if ! $self->perldoc; + # Do we have anything to do? + return () if $self->bugs eq 'none'; - # Get the name for the module - my $module = PPIx::DocumentName->extract( $ppi_doc ); + # Which kind of text should we display? + my $text = join( "\n", @{ $self->bugs_content } ); + if ( $self->bugs eq 'rt' ) + { + my $dist = $zilla->name; + my $mailto = "C"; + my $web = "L"; + + $text =~ s/\{WEB\}/$web/; + $text =~ s/\{EMAIL\}/$mailto/; + } + else + { + # code copied from Pod::Weaver::Section::Bugs, thanks RJBS! + $self->log_fatal('No bugtracker in metadata!') + unless exists $distmeta->{resources}{bugtracker}; + my $bugtracker = $distmeta->{resources}{bugtracker}; + my ( $web, $mailto ) = @{$bugtracker}{qw/web mailto/}; + $self->log_fatal('No bugtracker in metadata!') + unless defined $web || defined $mailto; + + $text =~ s/\{WEB\}/L\<$web\>/ if defined $web; + $text =~ s/\{EMAIL\}/C\<$mailto\>/ if defined $mailto; + + # sanity check the content + if ( $text =~ /\{WEB\}/ ) + { + $self->log_fatal( +"The metadata doesn't have a website for the bugtracker but you specified it in the bugs_content!" + ); + } + if ( $text =~ /\{EMAIL\}/ ) + { + $self->log_fatal( +"The metadata doesn't have an email for the bugtracker but you specified it in the bugs_content!" + ); + } + } + + return Pod::Elemental::Element::Nested->new( + { + command => 'head2', + content => 'Bugs / Feature Requests', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => $text, + } + ), + ], + } + ); +} + +sub _add_perldoc +{ + my ( $self, $ppi_doc ) = @_; + + # Do we have anything to do? + return () if !$self->perldoc; + + # Get the name for the module + my $module = PPIx::DocumentName->extract($ppi_doc); # Avoid trailing space and an empty directive - return () if ! length $module; + return () if !length $module; - # TODO add language detection as per RT#63726 + # TODO add language detection as per RT#63726 - return Pod::Elemental::Element::Nested->new( { - command => 'head2', - content => 'Perldoc', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => <<'EOPOD', + return Pod::Elemental::Element::Nested->new( + { + command => 'head2', + content => 'Perldoc', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => <<'EOPOD', You can find documentation for this module with the perldoc command. EOPOD - } ), - Pod::Elemental::Element::Pod5::Verbatim->new( { - content => " perldoc $module", - } ), - ], - } ); -} - -sub _add_irc { - my $self = shift; - my $zilla = shift; - - my @irc; - - # thanks to https://metacpan.org/about/metadata for the info! - if ( scalar @{ $self->irc } ) { - $self->log( 'IRC was set twice: in the metadata and in this plugin, overriding the metadata!' ) if exists $zilla->distmeta->{'x_IRC'}; - @irc = @{ $self->irc }; - } elsif ( exists $zilla->distmeta->{'x_IRC'} ) { - my $x_irc = $zilla->distmeta->{'x_IRC'}; - if ( ref $x_irc ) { # handle the newer url/web nested spec - $x_irc = $x_irc->{'url'}; - } - if ( $x_irc =~ m|^irc://([^/]+)/(.+)$| ) { - push( @irc, "$1,$2" ); - } else { - $self->log( "Error: the IRC metadata needs to be in the proper format: 'irc://servername.com/#room' but yours was: $x_irc" ); - return (); - } - } else { - return (); - } - - my @networks; - foreach my $entry ( @irc ) { - my( $net, @chans, @nicks ); - if ( $entry =~ m|^irc://([^/]+)/(.+)$| ) { - $net = $1; - push( @chans, $2 ); - } else { - # Split it into fields - my @data = split( /\,/, $entry ); - $_ =~ s/^\s+//g for @data; - $_ =~ s/\s+$//g for @data; - - # Add the network data! - $net = shift @data; - foreach my $e ( @data ) { - if ( $e =~ /^\#/ ) { - push( @chans, $e ); - } else { - push( @nicks, $e ); - } - } - } - - my $text = "You can connect to the server at '$net'"; - if ( @chans ) { - if ( @chans > 1 ) { - $text .= " and join those channels: "; - $text .= join( ' , ', @chans ); - } else { - $text .= " and join this channel: $chans[0]"; - } - } - if ( @nicks ) { - if ( @chans ) { - $text .= " then"; - } else { - $text .= " and"; - } - - if ( @nicks > 1 ) { - $text .= " talk to those people for help: "; - $text .= join( ' , ', @nicks ); - } else { - $text .= " talk to this person for help: $nicks[0]"; - } - } - if ( ! @nicks ) { - $text .= " to get help"; - } - $text .= '.'; - - push( @networks, _make_item( $net, $text ) ); - } - - return Pod::Elemental::Element::Nested->new( { - command => 'head2', - content => 'Internet Relay Chat', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => join( "\n", @{ $self->irc_content } ), - } ), - Pod::Elemental::Element::Nested->new( { - command => 'over', - content => '4', - children => [ - @networks, - Pod::Elemental::Element::Pod5::Command->new( { - command => 'back', - content => '', - } ), - ], - } ), - ], - } ); -} - -sub _add_repo { - my( $self, $zilla ) = @_; - - # Do we have anything to do? - return () if $self->repository_link eq 'none'; - - my $repo; - if ( exists $zilla->distmeta->{resources}{repository} ) { - $repo = $zilla->distmeta->{resources}{repository}; - } else { - $self->log_fatal( [ - "Repository information in meta.resources.repository is missing and you wanted: %s", - $self->repository_link eq 'both' ? 'both (web and url)' : $self->repository_link, - ] ); - } - - my $text = join( "\n", @{ $self->repository_content } ); - $text .= "\n"; # for the links to be appended - - # for dzil v3 with CPAN Meta v2 - if ( ref $repo ) { - # add the web url? - if ( $self->repository_link eq 'web' or $self->repository_link eq 'both' ) { - if ( exists $repo->{web} ) { - $text .= 'L<' . $repo->{web} . ">"; - } else { - $self->log_fatal("Expected to find 'web' repository link but it is missing in the metadata!"); - } - } - - if ( $self->repository_link eq 'url' or $self->repository_link eq 'both' ) { - if ( ! exists $repo->{url} ) { - $self->log_fatal("Expected to find 'url' repository link but it is missing in the metadata!"); - } - - if ( $self->repository_link eq 'both' ) { - $text .= "\n\n"; - } - - # do we have a type? - $text .= ' '; - if ( exists $repo->{type} ) { - # list of repo types taken from Dist::Zilla::Plugin::Repository v0.16 - if ( $repo->{type} eq 'git' ) { - $text .= 'git clone'; - } elsif ( $repo->{type} eq 'svn' ) { - $text .= 'svn checkout'; - } elsif ( $repo->{type} eq 'darcs' ) { - $text .= 'darcs get'; - } elsif ( $repo->{type} eq 'hg' ) { - $text .= 'hg clone'; - } else { - # TODO add support for other formats? cvs/bzr? they're not in DZP::Repository... - } - - $text .= ' ' . $repo->{url}; - } else { - $text .= $repo->{url}; - } - } - } else { - $self->log_warning("You need to update Dist::Zilla::Plugin::Repository to at least v0.15 for the correct metadata!"); - $text .= "L<$repo>"; - } - - return Pod::Elemental::Element::Nested->new( { - command => 'head2', - content => 'Source Code', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => $text, - } ), - ], - } ); -} - -sub _add_websites { - my( $self, $zilla ) = @_; - - # Do we have anything to do? - return () if ! scalar @{ $self->websites }; - return () if grep { $_ eq 'none' } @{ $self->websites }; ## no critic ( BuiltinFunctions::ProhibitBooleanGrep ) - - # explode CSV lists - my @newlist; - foreach my $w ( @{ $self->websites } ) { - if ( $w =~ /,/ ) { - my @list = split( /\,/, $w ); - $_ =~ s/^\s+//g for @list; - $_ =~ s/\s+$//g for @list; - push( @newlist, @list ); - } else { - $w =~ s/^\s+//g; - $w =~ s/\s+$//g; - push( @newlist, $w ); - } - } - @{ $self->websites } = @newlist; - - # sanity check - foreach my $type ( @{ $self->websites } ) { - if ( $type !~ /^(?:metacpan|search|rt|ratings|kwalitee|testers|testmatrix|deps|all)$/i ) { - $self->log_fatal( "Unknown website type: $type" ); - } - } - - # Set the default ordering for "all" - if ( grep { $_ eq 'all' } @{ $self->websites } ) { ## no critic ( BuiltinFunctions::ProhibitBooleanGrep ) - @{ $self->websites } = qw( metacpan search rt ratings kwalitee testers testmatrix deps ); - } - - # Make the website links! - my @links; - my %seen_type; - foreach my $type ( @{ $self->websites } ) { - next if $seen_type{$type}++; - $type = '_add_websites_' . $type; - my $main_module = $zilla->main_module->name; - $main_module =~ s|^lib/||i; - $main_module =~ s/\.pm$//; - $main_module =~ s|/|::|g; - - # TODO I'm too lazy to build a proper dispatch table... - no strict 'refs'; - push( @links, &$type( $zilla->name, $main_module ) ); - } - - return Pod::Elemental::Element::Nested->new( { - command => 'head2', - content => 'Websites', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => join( "\n", @{ $self->websites_content } ), - } ), - Pod::Elemental::Element::Nested->new( { - command => 'over', - content => '4', - children => [ - @links, - Pod::Elemental::Element::Pod5::Command->new( { - command => 'back', - content => '', - } ), - ], - } ), - ], - } ); + } + ), + Pod::Elemental::Element::Pod5::Verbatim->new( + { + content => " perldoc $module", + } + ), + ], + } + ); } -sub _add_websites_metacpan { - my $dist = shift; +sub _add_irc +{ + my $self = shift; + my $zilla = shift; - return _make_item( 'MetaCPAN', <<"EOF" ); -A modern, open-source CPAN search engine, useful to view POD in HTML format. + my @irc; -L -EOF + # thanks to https://metacpan.org/about/metadata for the info! + if ( scalar @{ $self->irc } ) + { + $self->log( +'IRC was set twice: in the metadata and in this plugin, overriding the metadata!' + ) if exists $zilla->distmeta->{'x_IRC'}; + @irc = @{ $self->irc }; + } + elsif ( exists $zilla->distmeta->{'x_IRC'} ) + { + my $x_irc = $zilla->distmeta->{'x_IRC'}; + if ( ref $x_irc ) + { # handle the newer url/web nested spec + $x_irc = $x_irc->{'url'}; + } + if ( $x_irc =~ m|^irc://([^/]+)/(.+)$| ) + { + push( @irc, "$1,$2" ); + } + else + { + $self->log( +"Error: the IRC metadata needs to be in the proper format: 'irc://servername.com/#room' but yours was: $x_irc" + ); + return (); + } + } + else + { + return (); + } + + my @networks; + foreach my $entry (@irc) + { + my ( $net, @chans, @nicks ); + if ( $entry =~ m|^irc://([^/]+)/(.+)$| ) + { + $net = $1; + push( @chans, $2 ); + } + else + { + # Split it into fields + my @data = split( /\,/, $entry ); + $_ =~ s/^\s+//g for @data; + $_ =~ s/\s+$//g for @data; + + # Add the network data! + $net = shift @data; + foreach my $e (@data) + { + if ( $e =~ /^\#/ ) + { + push( @chans, $e ); + } + else + { + push( @nicks, $e ); + } + } + } + + my $text = "You can connect to the server at '$net'"; + if (@chans) + { + if ( @chans > 1 ) + { + $text .= " and join those channels: "; + $text .= join( ' , ', @chans ); + } + else + { + $text .= " and join this channel: $chans[0]"; + } + } + if (@nicks) + { + if (@chans) + { + $text .= " then"; + } + else + { + $text .= " and"; + } + + if ( @nicks > 1 ) + { + $text .= " talk to those people for help: "; + $text .= join( ' , ', @nicks ); + } + else + { + $text .= " talk to this person for help: $nicks[0]"; + } + } + if ( !@nicks ) + { + $text .= " to get help"; + } + $text .= '.'; + + push( @networks, _make_item( $net, $text ) ); + } + + return Pod::Elemental::Element::Nested->new( + { + command => 'head2', + content => 'Internet Relay Chat', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => join( "\n", @{ $self->irc_content } ), + } + ), + Pod::Elemental::Element::Nested->new( + { + command => 'over', + content => '4', + children => [ + @networks, + Pod::Elemental::Element::Pod5::Command->new( + { + command => 'back', + content => '', + } + ), + ], + } + ), + ], + } + ); } -sub _add_websites_search { - my $dist = shift; +sub _add_repo +{ + my ( $self, $zilla ) = @_; - return _make_item( 'Search CPAN', <<"EOF" ); -The default CPAN search engine, useful to view POD in HTML format. + # Do we have anything to do? + return () if $self->repository_link eq 'none'; -L -EOF + my $repo; + if ( exists $zilla->distmeta->{resources}{repository} ) + { + $repo = $zilla->distmeta->{resources}{repository}; + } + else + { + $self->log_fatal( + [ +"Repository information in meta.resources.repository is missing and you wanted: %s", + $self->repository_link eq 'both' + ? 'both (web and url)' + : $self->repository_link, + ] + ); + } + + my $text = join( "\n", @{ $self->repository_content } ); + $text .= "\n"; # for the links to be appended + + # for dzil v3 with CPAN Meta v2 + if ( ref $repo ) + { + # add the web url? + if ( $self->repository_link eq 'web' + or $self->repository_link eq 'both' ) + { + if ( exists $repo->{web} ) + { + $text .= 'L<' . $repo->{web} . ">"; + } + else + { + $self->log_fatal( +"Expected to find 'web' repository link but it is missing in the metadata!" + ); + } + } + + if ( $self->repository_link eq 'url' + or $self->repository_link eq 'both' ) + { + if ( !exists $repo->{url} ) + { + $self->log_fatal( +"Expected to find 'url' repository link but it is missing in the metadata!" + ); + } + + if ( $self->repository_link eq 'both' ) + { + $text .= "\n\n"; + } + + # do we have a type? + $text .= ' '; + if ( exists $repo->{type} ) + { + # list of repo types taken from Dist::Zilla::Plugin::Repository v0.16 + if ( $repo->{type} eq 'git' ) + { + $text .= 'git clone'; + } + elsif ( $repo->{type} eq 'svn' ) + { + $text .= 'svn checkout'; + } + elsif ( $repo->{type} eq 'darcs' ) + { + $text .= 'darcs get'; + } + elsif ( $repo->{type} eq 'hg' ) + { + $text .= 'hg clone'; + } + else + { +# TODO add support for other formats? cvs/bzr? they're not in DZP::Repository... + } + + $text .= ' ' . $repo->{url}; + } + else + { + $text .= $repo->{url}; + } + } + } + else + { + $self->log_warning( +"You need to update Dist::Zilla::Plugin::Repository to at least v0.15 for the correct metadata!" + ); + $text .= "L<$repo>"; + } + + return Pod::Elemental::Element::Nested->new( + { + command => 'head2', + content => 'Source Code', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => $text, + } + ), + ], + } + ); } -sub _add_websites_rt { - my $dist = shift; +sub _add_websites +{ + my ( $self, $zilla ) = @_; - return _make_item( "RT: CPAN's Bug Tracker", <<"EOF" ); -The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. + # Do we have anything to do? + return () if !scalar @{ $self->websites }; + return () + if grep { $_ eq 'none' } + @{ $self->websites } + ; ## no critic ( BuiltinFunctions::ProhibitBooleanGrep ) + + # explode CSV lists + my @newlist; + foreach my $w ( @{ $self->websites } ) + { + if ( $w =~ /,/ ) + { + my @list = split( /\,/, $w ); + $_ =~ s/^\s+//g for @list; + $_ =~ s/\s+$//g for @list; + push( @newlist, @list ); + } + else + { + $w =~ s/^\s+//g; + $w =~ s/\s+$//g; + push( @newlist, $w ); + } + } + @{ $self->websites } = @newlist; + + # sanity check + foreach my $type ( @{ $self->websites } ) + { + if ( $type !~ +/^(?:metacpan|search|rt|ratings|kwalitee|testers|testmatrix|deps|all)$/i + ) + { + $self->log_fatal("Unknown website type: $type"); + } + } + + # Set the default ordering for "all" + if ( grep { $_ eq 'all' } @{ $self->websites } ) + { ## no critic ( BuiltinFunctions::ProhibitBooleanGrep ) + @{ $self->websites } = + qw( metacpan search rt ratings kwalitee testers testmatrix deps ); + } + + # Make the website links! + my @links; + my %seen_type; + foreach my $type ( @{ $self->websites } ) + { + next if $seen_type{$type}++; + $type = '_add_websites_' . $type; + my $main_module = $zilla->main_module->name; + $main_module =~ s|^lib/||i; + $main_module =~ s/\.pm$//; + $main_module =~ s|/|::|g; + + # TODO I'm too lazy to build a proper dispatch table... + no strict 'refs'; + push( @links, &$type( $zilla->name, $main_module ) ); + } + + return Pod::Elemental::Element::Nested->new( + { + command => 'head2', + content => 'Websites', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => join( "\n", @{ $self->websites_content } ), + } + ), + Pod::Elemental::Element::Nested->new( + { + command => 'over', + content => '4', + children => [ + @links, + Pod::Elemental::Element::Pod5::Command->new( + { + command => 'back', + content => '', + } + ), + ], + } + ), + ], + } + ); +} -L +sub _add_websites_metacpan +{ + my $dist = shift; + + return _make_item( 'MetaCPAN', <<"EOF" ); +A modern, open-source CPAN search engine, useful to view POD in HTML format. + +L EOF } -sub _add_websites_ratings { - my $dist = shift; +sub _add_websites_search +{ + # See https://github.com/shlomif/HTML-Spelling-Site/issues/2 . + return; +} + +sub _add_websites_rt +{ + my $dist = shift; - return _make_item( 'CPAN Ratings', <<"EOF" ); -The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. + return _make_item( "RT: CPAN's Bug Tracker", <<"EOF" ); +The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. -L +L EOF } -sub _add_websites_kwalitee { - my $dist = shift; +sub _add_websites_ratings +{ + # See https://github.com/shlomif/HTML-Spelling-Site/issues/2 . + return; +} - return _make_item( 'CPANTS', <<"EOF" ); +sub _add_websites_kwalitee +{ + my $dist = shift; + + return _make_item( 'CPANTS', <<"EOF" ); The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. L EOF } -sub _add_websites_testers { - my $dist = shift; +sub _add_websites_testers +{ + my $dist = shift; - my $first_char = substr( $dist, 0, 1 ); + my $first_char = substr( $dist, 0, 1 ); - return _make_item( 'CPAN Testers', <<"EOF" ); + return _make_item( 'CPAN Testers', <<"EOF" ); The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. L EOF } -sub _add_websites_testmatrix { - my $dist = shift; +sub _add_websites_testmatrix +{ + my $dist = shift; - return _make_item( 'CPAN Testers Matrix', <<"EOF" ); + return _make_item( 'CPAN Testers Matrix', <<"EOF" ); The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. L EOF } -sub _add_websites_deps { - my $module = $_[1]; +sub _add_websites_deps +{ + my $module = $_[1]; - return _make_item( 'CPAN Testers Dependencies', <<"EOF" ); + return _make_item( 'CPAN Testers Dependencies', <<"EOF" ); The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. L EOF } -sub _make_item { - my( $title, $contents ) = @_; +sub _make_item +{ + my ( $title, $contents ) = @_; - my $str = $title; - if ( defined $contents ) { - $str .= "\n\n$contents"; - } - - return Pod::Elemental::Element::Nested->new( { - command => 'item', - content => '*', - children => [ - Pod::Elemental::Element::Pod5::Ordinary->new( { - content => $str, - } ), - ], - } ); + my $str = $title; + if ( defined $contents ) + { + $str .= "\n\n$contents"; + } + + return Pod::Elemental::Element::Nested->new( + { + command => 'item', + content => '*', + children => [ + Pod::Elemental::Element::Pod5::Ordinary->new( + { + content => $str, + } + ), + ], + } + ); } 1; @@ -645,7 +807,7 @@ =head1 VERSION -version 1.012 +version 1.013 =head1 DESCRIPTION @@ -702,15 +864,13 @@ specify it as a comma-delimited string. The ordering of the options are important, as they are reflected in the final POD. -Valid options are: "none", "metacpan", "search", "rt", "ratings", "kwalitee", "testers", "testmatrix", "deps" and "all". +Valid options are: "none", "metacpan", "rt", "kwalitee", "testers", "testmatrix", "deps" and "all". The default is "all". # Where the links go to: metacpan - https://metacpan.org/release/$dist - search - http://search.cpan.org/dist/$dist rt - https://rt.cpan.org/Public/Dist/Display.html?Name=$dist - ratings - http://cpanratings.perl.org/d/$dist kwalitee - http://cpants.perl.org/dist/$dist testers - http://cpantesters.org/distro/$first_char/$dist testmatrix - http://matrix.cpantesters.org/?dist=$dist diff -Nru libpod-weaver-section-support-perl-1.012/Makefile.PL libpod-weaver-section-support-perl-1.013/Makefile.PL --- libpod-weaver-section-support-perl-1.012/Makefile.PL 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/Makefile.PL 2020-02-07 16:32:39.000000000 +0000 @@ -34,7 +34,7 @@ "Test::More" => "0.88", "warnings" => 0 }, - "VERSION" => "1.012", + "VERSION" => "1.013", "test" => { "TESTS" => "t/*.t" } diff -Nru libpod-weaver-section-support-perl-1.012/META.json libpod-weaver-section-support-perl-1.013/META.json --- libpod-weaver-section-support-perl-1.012/META.json 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/META.json 2020-02-07 16:32:39.000000000 +0000 @@ -60,7 +60,7 @@ "provides" : { "Pod::Weaver::Section::Support" : { "file" : "lib/Pod/Weaver/Section/Support.pm", - "version" : "1.012" + "version" : "1.013" } }, "release_status" : "stable", @@ -75,7 +75,7 @@ "web" : "https://github.com/shlomif/perl-pod-weaver-section-support" } }, - "version" : "1.012", + "version" : "1.013", "x_Dist_Zilla" : { "perl" : { "version" : "5.030001" @@ -396,7 +396,7 @@ { "class" : "Pod::Weaver::Section::Support", "name" : "Support", - "version" : "1.011" + "version" : "1.012" } ] } diff -Nru libpod-weaver-section-support-perl-1.012/META.yml libpod-weaver-section-support-perl-1.013/META.yml --- libpod-weaver-section-support-perl-1.012/META.yml 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/META.yml 2020-02-07 16:32:39.000000000 +0000 @@ -23,7 +23,7 @@ provides: Pod::Weaver::Section::Support: file: lib/Pod/Weaver/Section/Support.pm - version: '1.012' + version: '1.013' requires: Moose: '1.03' Moose::Util::TypeConstraints: '1.01' @@ -34,7 +34,7 @@ bugtracker: https://github.com/shlomif/pod-weaver-section-support/issues homepage: http://metacpan.org/release/Pod-Weaver-Section-Support repository: https://github.com/shlomif/perl-pod-weaver-section-support -version: '1.012' +version: '1.013' x_Dist_Zilla: perl: version: '5.030001' @@ -285,7 +285,7 @@ - class: Pod::Weaver::Section::Support name: Support - version: '1.011' + version: '1.012' name: '@Filter/PodWeaver' version: '4.008' - diff -Nru libpod-weaver-section-support-perl-1.012/README libpod-weaver-section-support-perl-1.013/README --- libpod-weaver-section-support-perl-1.012/README 2019-12-28 18:52:09.000000000 +0000 +++ libpod-weaver-section-support-perl-1.013/README 2020-02-07 16:32:39.000000000 +0000 @@ -1,5 +1,5 @@ This archive contains the distribution Pod-Weaver-Section-Support, -version 1.012: +version 1.013: Add a SUPPORT section to your POD