blib/lib/App/Nopaste/Service/Sprunge.pm

filter: Statementstmt 52.3% 11 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 53.3% 16 / 30 CC 2 SCAR 10.4
CC
2
Cov
48%
run
6.0
available
2.0
BEGIN
1.0
CRAP 2.8
↑ Summary
1 package App::Nopaste::Service::Sprunge;
2 # ABSTRACT: adds sprunge.us support to App::Nopaste
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 our $VERSION = '0.004'; # VERSION
6 1 ▶use base 'App::Nopaste::Service';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 0 ▶sub available {
Subroutine available: not called CC=1 SCAR=6.9
Pod documented
10 0 eval {
11 0 require WWW::Pastebin::Sprunge::Create;
12 0 1;
13 };
14 }
15  
16  
17 0 ▶sub run {
Subroutine run: not called CC=2 SCAR=17.9
Pod documented
18 0 my $self = shift;
19 0 my %args = @_;
20  
21 0 require WWW::Pastebin::Sprunge::Create;
22  
23 0 my $paster = WWW::Pastebin::Sprunge::Create->new();
24 my $ok = $paster->paste(
25 $args{'text'},
26 0 lang => $args{'lang'},
27 );
28  
29 0 ▶ return (0, $paster->error) unless $ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $ok 0 0 0
30 0 return (1, $paster->paste_uri);
31 }
32  
33  
34 1 1;
35  
36  
37  
38 =pod
39  
40 =encoding utf-8
41  
42 =head1 NAME
43  
44 App::Nopaste::Service::Sprunge - adds sprunge.us support to App::Nopaste
45  
46 =head1 VERSION
47  
48 version 0.004
49  
50 =head1 METHODS
51  
52 =head2 available
53  
54 Returns whether or not L<WWW::Pastebin::Sprunge::Create> is
55 available so we can actually paste to L<http://sprunge.us>.
56  
57 =head2 run
58  
59 Run the application code to paste to L<http://sprunge.us>.
60  
61 =head1 SEE ALSO
62  
63 L<WWW::Pastebin::Sprunge::Create>
64  
65 =head1 AVAILABILITY
66  
67 The latest version of this module is available from the Comprehensive Perl
68 Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
69 site near you, or see L<http://search.cpan.org/dist/App-Nopaste-Service-Sprunge/>.
70  
71 The development version lives at L<http://github.com/doherty/App-Nopaste-Service-Sprunge>
72 and may be cloned from L<git://github.com/doherty/App-Nopaste-Service-Sprunge.git>.
73 Instead of sending patches, please fork this project using the standard
74 git and github infrastructure.
75  
76 =head1 SOURCE
77  
78 The development version is on github at L<http://github.com/doherty/App-Nopaste-Service-Sprunge>
79 and may be cloned from L<git://github.com/doherty/App-Nopaste-Service-Sprunge.git>
80  
81 =head1 BUGS AND LIMITATIONS
82  
83 No bugs have been reported.
84  
85 Please report any bugs or feature requests through the web interface at
86 L<https://github.com/doherty/App-Nopaste-Service-Sprunge/issues>.
87  
88 =head1 AUTHOR
89  
90 Mike Doherty <doherty@cpan.org>
91  
92 =head1 COPYRIGHT AND LICENSE
93  
94 This software is copyright (c) 2100 by Mike Doherty.
95  
96 This is free software; you can redistribute it and/or modify it under
97 the same terms as the Perl 5 programming language system itself.
98  
99 =cut
100  
101  
102 __END__
↑ Summary