| 1 | package Hubot::Scripts::ascii; | ||||||||||||||||||||||||||||
| 2 | 2 | $Hubot::Scripts::ascii::VERSION = '0.2.8'; | |||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | sub load { | ||||||||||||||||||||||||||
|
Subroutine
load: called CC=1 SCAR=0.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 7 | 1 | my ( $class, $robot ) = @_; | |||||||||||||||||||||||||||
| 8 | $robot->hear( | ||||||||||||||||||||||||||||
| 9 | qr/^ascii:?( me)? (.+)/i, | ||||||||||||||||||||||||||||
| 10 | 1 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.9
| |||||||||||||||||||||||||||||
| 11 | 1 | my $msg = shift; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | $msg->http('http://www.kammerl.de/ascii/AsciiSignature.php')->post( | ||||||||||||||||||||||||||||
| 14 | { figletfont => "3", figlettext => $msg->match->[1] }, | ||||||||||||||||||||||||||||
| 15 | 1 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=15.1
| |||||||||||||||||||||||||||||
| 16 | 1 | my ( $body, $hdr ) = @_; | |||||||||||||||||||||||||||
| 17 | 1 | ▶ | return if ( !$body || !$hdr->{Status} =~ /^2/ ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $body or !$hdr->{"Status"} =~ /^2/
MC/DC0%0/2
not $body or !$hdr->{"Status"} =~ /^2/
not $body
!$hdr->{"Status"} =~ /^2/
Truth table33%1/3
not(A) or not(B)
A= not $bodyB= !$hdr->{"Status"} =~ /^2/
| |||||||||||||||||||||||||||||
| 18 | 0 | my ($ascii) = $body =~ m/<small>(.*?)<\/small><br\/>/is; | |||||||||||||||||||||||||||
| 19 | 0 | $msg->send( split( /\n/, $ascii ) ); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | 1 | ); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 1 | ); | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 2 | 1; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =pod | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | =encoding utf-8 | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | =head1 NAME | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | Hubot::Scripts::ascii | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head1 VERSION | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | version 0.2.8 | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | ascii me <text> - Show text in ascii art | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | Hyungsuk Hong <hshong@perl.kr> | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | This software is copyright (c) 2012 by Hyungsuk Hong. | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 53 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =cut | ||||||||||||||||||||||||||||