lita-irc 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/lita/adapters/irc.rb +1 -0
- data/lib/lita/adapters/irc/cinch_plugin.rb +5 -0
- data/lita-irc.gemspec +2 -2
- data/spec/lita/adapters/irc/cinch_plugin_spec.rb +7 -0
- data/spec/lita/adapters/irc_spec.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f604d9501a4695877a1801bcc661adb5c652ba63
|
4
|
+
data.tar.gz: 586061b815ac4f09aa0f138030503324d829c42f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59dee289523fcb3335ca46a7101595b6d84361fffe83fb72ec9f7dfc2027a15d24e23dcd9addadf9b844c5275c31320bb3fc019b037f8b019e7547500f6ccd9c
|
7
|
+
data.tar.gz: 6e9ec04a816b4a3b2047e38f4f094458e351deffdc75b8dd1bd0278792a1bf2d32684bcf326bbe9882c8bb4420f515ef7eeb53bfc3b2bb03dbcf26a303c255cc
|
data/README.md
CHANGED
@@ -51,6 +51,10 @@ Lita.configure do |config|
|
|
51
51
|
end
|
52
52
|
```
|
53
53
|
|
54
|
+
## Events
|
55
|
+
|
56
|
+
The IRC adapter will trigger the `:connected` and `:disconnected` events when the robot has connected and disconnected from IRC, respectively. There is no payload data for either event.
|
57
|
+
|
54
58
|
## License
|
55
59
|
|
56
60
|
[MIT](http://opensource.org/licenses/MIT)
|
data/lib/lita/adapters/irc.rb
CHANGED
@@ -7,6 +7,7 @@ module Lita
|
|
7
7
|
include Cinch::Plugin
|
8
8
|
|
9
9
|
match /.*/
|
10
|
+
listen_to :connect, method: :on_connect
|
10
11
|
listen_to :invite, method: :on_invite
|
11
12
|
|
12
13
|
def execute(m)
|
@@ -17,6 +18,10 @@ module Lita
|
|
17
18
|
dispatch(message)
|
18
19
|
end
|
19
20
|
|
21
|
+
def on_connect(m)
|
22
|
+
robot.trigger(:connected)
|
23
|
+
end
|
24
|
+
|
20
25
|
def on_invite(m)
|
21
26
|
user = user_by_nick(m.user.nick)
|
22
27
|
m.channel.join if Lita::Authorization.user_is_admin?(user)
|
data/lita-irc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-irc"
|
3
|
-
spec.version = "1.
|
3
|
+
spec.version = "1.2.0"
|
4
4
|
spec.authors = ["Jimmy Cuadra"]
|
5
5
|
spec.email = ["jimmy@jimmycuadra.com"]
|
6
6
|
spec.description = %q{An IRC adapter for Lita.}
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
14
14
|
spec.require_paths = ["lib"]
|
15
15
|
|
16
|
-
spec.add_runtime_dependency "lita", "~> 2.
|
16
|
+
spec.add_runtime_dependency "lita", "~> 2.5"
|
17
17
|
spec.add_runtime_dependency "cinch", "~> 2.0"
|
18
18
|
|
19
19
|
spec.add_development_dependency "bundler", "~> 1.3"
|
@@ -66,6 +66,13 @@ describe Lita::Adapters::IRC::CinchPlugin do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
describe "#on_connect" do
|
70
|
+
it "triggers a connected event on the robot" do
|
71
|
+
expect(robot).to receive(:trigger).with(:connected)
|
72
|
+
subject.on_connect(double)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
69
76
|
describe "#on_invite" do
|
70
77
|
it "joins the room if the invite came from an admin" do
|
71
78
|
allow(subject).to receive(:user_by_nick).and_return(user)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-irc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Cuadra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: cinch
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.1.3
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: An IRC adapter for the Lita chat robot.
|