Pod/Weaver/Section/RSRCHBOY/Authors.pm

filter: Statementstmt 56.3% 31 / 55 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 72.7% 8 / 11 Podpod n/a totaltotal 50.0% 39 / 78 CC 5 SCAR 19.1
CC
5
Cov
48%
__ANON__
20.0
__ANON__
6.0
__ANON__
1.1
CRAP 6.7
« Dist/Zilla/PluginBundle/RSRCHBOY.pm ↑ Summary Pod/Weaver/PluginBundle/RSRCHBOY.pm »
1 #
2 # This file is part of Dist-Zilla-PluginBundle-RSRCHBOY
3 #
4 # This software is Copyright (c) 2026 by Chris Weyl.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 package Pod::Weaver::Section::RSRCHBOY::Authors;
11 1 our $AUTHORITY = 'cpan:RSRCHBOY';
12 1 $Pod::Weaver::Section::RSRCHBOY::Authors::VERSION = '0.080';
13 # ABSTRACT: An AUTHORS section with materialistic pleasures
14  
15 1 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use autobox::Core;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use MooseX::AttributeShortcuts;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 ▶use aliased 'Pod::Elemental::Element::Pod5::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use aliased 'Pod::Elemental::Element::Pod5::Ordinary';
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 ▶use URI::Escape::XS 'uri_escape';
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 1 extends 'Pod::Weaver::Section::Authors';
28  
29  
30 0 ▶has feed_me => (is => 'rw', isa => 'Bool', lazy => 1, builder => sub { 0 });
Subroutine __ANON__: not called CC=1 SCAR=1.2
31  
32 0 ▶before weave_section => sub {
Subroutine __ANON__: not called CC=4 SCAR=30.0
33 0 my ($self, $output, $input) = @_;
34  
35 # skip this unless we're under dzil *and* have the right stash
36 0 ▶ return unless $input && $input->{zilla};
Branch: 1 branch
BranchTrueFalseTotal
unless $input and $input->{"zilla"} 0 0 0
Condition0%0/3
$input and $input->{"zilla"}
!ll&&!rl&&r
000
MC/DC0%0/2
$input and $input->{"zilla"}
$input $input->{"zilla"}
Truth table0%0/3
A and B
A= $inputB= $input->{"zilla"}
ABresult
0X0
100
111
37 0 ▶ my $stash = $input->{zilla}->stash_named('%PodWeaver') // return;
Condition0%0/2
$input->{"zilla"}->stash_named("%PodWeaver") // (return)
l!l
00
MC/DC0%0/1
$input->{"zilla"}->stash_named("%PodWeaver") // (return)
$input->{"zilla"}->stash_named("%PodWeaver")
Truth table0%0/2
A
A= $input->{"zilla"}->stash_named("%PodWeaver")
Aresult
11
00
38  
39 0 $stash->merge_stashed_config($self);
40 0 return;
41 1 };
42  
43 0 ▶after weave_section => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
44 0 my ($self, $output, $input) = @_;
45  
46 0 ▶ return unless $self->feed_me;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->feed_me 0 0 0
47  
48 0 my $name = $input->{distmeta}->{name};
49  
50 0 my $flattr_img = 'http://api.flattr.com/button/flattr-badge-large.png';
51 0 my $flattr_title = uri_escape("RsrchBoy's CPAN $name");
52 0 my $flattr_tag = uri_escape(qq{"RsrchBoy's $name in the CPAN"});
53 0 my $flattr_url = uri_escape($input->{distmeta}->{resources}->{homepage});
54 0 my $flattr_link = "https://flattr.com/submit/auto?user_id=RsrchBoy&url=$flattr_url&title=$flattr_title&tags=$flattr_tag";
55  
56 0 my $gittip_link = 'https://gratipay.com/RsrchBoy/';
57 0 my $gittip_img = 'http://img.shields.io/gratipay/RsrchBoy.svg';
58  
59 # L<Amazon Wishlist|http://www.amazon.com/gp/registry/wishlist/3G2DQFPBA57L6>.
60 0 my $amzn_img = 'http://wps.io/wp-content/uploads/2014/05/amazon_wishlist.resized.png';
61 0 my $amzn_link = 'http://bit.ly/rsrchboys-wishlist';
62  
63 0 my $html = <<"EOT";
64 <a href="$gittip_link"><img src="$gittip_img" /></a>
65 <a href="$amzn_link"><img src="$amzn_img" /></a>
66 <a href="$flattr_link"><img src="$flattr_img" /></a>
67 EOT
68  
69 0 my $links = <<"EOT";
70 L<Flattr|$flattr_link>,
71 L<Gratipay|$gittip_link>, or indulge my
72 L<Amazon Wishlist|$amzn_link>... If and *only* if you so desire.
73 EOT
74  
75 0 my $text = <<"EOT";
76 Please note B<I do not expect to be gittip'ed or flattr'ed for this work>,
77 rather B<it is simply a very pleasant surprise>. I largely create and release
78 works like this because I need them or I find it enjoyable; however, don't let
79 that stop you if you feel like it ;)
80 EOT
81  
82 0 $output->children->unshift(
83 Command->new({
84 command => 'for',
85 content => q{:stopwords Wishlist flattr flattr'ed gittip gittip'ed},
86 }),
87 );
88 0 $output->children->[-1]->children->push(
89 Command->new({
90 command => 'head2',
91 content => q{I'm a material boy in a material world},
92 }),
93 Command ->new({ command => 'begin', content => 'html' }),
94 Ordinary->new({ content => $html }),
95 Command ->new({ command => 'end', content => 'html' }),
96 Ordinary->new({ content => $text }),
97 Ordinary->new({ content => $links }),
98 );
99  
100 0 return;
101 1 };
102  
103 1 __PACKAGE__->meta->make_immutable;
104 1 !!42;
105  
106 __END__
« Dist/Zilla/PluginBundle/RSRCHBOY.pm ↑ Summary Pod/Weaver/PluginBundle/RSRCHBOY.pm »