| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Hubot::Adapter; |
|
2
|
|
|
|
|
|
|
$Hubot::Adapter::VERSION = '0.2.7'; |
|
3
|
1
|
|
|
1
|
|
2295
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use namespace::autoclean; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'Hubot::EventEmitter'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'robot' => ( is => 'ro', isa => 'Hubot::Robot' ); |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub send { } |
|
11
|
|
|
|
|
|
|
sub whisper { } |
|
12
|
|
|
|
|
|
|
sub reply { } |
|
13
|
|
|
|
|
|
|
sub run { } |
|
14
|
|
|
|
|
|
|
sub close { } |
|
15
|
|
|
|
|
|
|
sub exist { } |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub receive { shift->robot->receive(@_) } |
|
18
|
|
|
|
|
|
|
sub users { shift->robot->users } |
|
19
|
|
|
|
|
|
|
sub userForId { shift->robot->userForId(@_) } |
|
20
|
|
|
|
|
|
|
sub userForName { shift->robot->userForName(@_) } |
|
21
|
|
|
|
|
|
|
sub usersForFuzzyRawName { shift->robot->usersForFuzzyRawName(@_) } |
|
22
|
|
|
|
|
|
|
sub usersForFuzzyName { shift->robot->usersForFuzzyName(@_) } |
|
23
|
|
|
|
|
|
|
sub http { shift->robot->http(@_) } |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding utf-8 |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Hubot::Adapter - specific interface to a chat source for robots. |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 0.2.7 |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
use Hubot::Robot; |
|
44
|
|
|
|
|
|
|
my $robot = Hubot::Robot->new({ |
|
45
|
|
|
|
|
|
|
adapter => 'Shell', |
|
46
|
|
|
|
|
|
|
name => 'hubot' |
|
47
|
|
|
|
|
|
|
}); |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$robot->adapter->on('connected', sub { |
|
50
|
|
|
|
|
|
|
## do something |
|
51
|
|
|
|
|
|
|
}); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
## Hubot::Adapter::XXX |
|
54
|
|
|
|
|
|
|
## `ADAPTER` must implements `run` method |
|
55
|
|
|
|
|
|
|
sub run { |
|
56
|
|
|
|
|
|
|
my $self = shift; |
|
57
|
|
|
|
|
|
|
## do something |
|
58
|
|
|
|
|
|
|
$self->emit('connected'); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Adapters are the interface to the service you want your hubot to run on. |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AVAILABLE ADAPTERS |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 BUILT IN |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=over |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item L<Shell|Hubot::Adapter::Shell> |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item L<IRC|Hubot::Adapter::Irc> |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item L<Campfire|Hubot::Adapter::Campfire> |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=back |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Hyungsuk Hong <hshong@perl.kr> |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Hyungsuk Hong. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
88
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |