ellen 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ellen/action.rb +4 -0
- data/lib/ellen/actions/help.rb +1 -1
- data/lib/ellen/actions/whoami.rb +9 -0
- data/lib/ellen/handlers/whoami.rb +15 -0
- data/lib/ellen/version.rb +1 -1
- data/lib/ellen.rb +2 -0
- data/spec/ellen/handlers/help_spec.rb +1 -0
- data/spec/ellen/handlers/whoami_spec.rb +36 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42106e5b3f728f10699b2df58912880a79c5d7db
|
4
|
+
data.tar.gz: c1eaf31cb606523ad78ba27aee2c6307e19294da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb5824e7ccd1d278e83fbe1e897bd2fa34232434ad38cb49955789c23739fdf20431043343871226896403e1b06c598b4a2dfb15b2d630e960a8097e48eeeb71
|
7
|
+
data.tar.gz: e77767ace69af879d7d0effe41e24ae1c24c1cc7ed663d9233001025c08d0f7807c0a98f813743f4ede6690c68a84c9105f8e8d6883d2823fb28d10f7a85a4e0
|
data/CHANGELOG.md
CHANGED
data/lib/ellen/action.rb
CHANGED
data/lib/ellen/actions/help.rb
CHANGED
@@ -12,7 +12,7 @@ module Ellen
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def action_descriptions
|
15
|
-
Ellen.actions.reject(&:hidden?).map do |action|
|
15
|
+
Ellen.actions.reject(&:hidden?).sort.map do |action|
|
16
16
|
prefix = ""
|
17
17
|
prefix << message.robot.name << " " unless action.all?
|
18
18
|
"%-#{pattern_max_length + prefix.size}s - #{action.description}" % "#{prefix}#{action.pattern.inspect}"
|
data/lib/ellen/version.rb
CHANGED
data/lib/ellen.rb
CHANGED
@@ -34,6 +34,7 @@ require "ellen/action"
|
|
34
34
|
require "ellen/actions/base"
|
35
35
|
require "ellen/actions/help"
|
36
36
|
require "ellen/actions/ping"
|
37
|
+
require "ellen/actions/whoami"
|
37
38
|
require "ellen/adapter_builder"
|
38
39
|
require "ellen/env"
|
39
40
|
require "ellen/env/missing_required_key_error"
|
@@ -50,6 +51,7 @@ require "ellen/commands/run"
|
|
50
51
|
require "ellen/handlers/base"
|
51
52
|
require "ellen/handlers/help"
|
52
53
|
require "ellen/handlers/ping"
|
54
|
+
require "ellen/handlers/whoami"
|
53
55
|
require "ellen/logger"
|
54
56
|
require "ellen/message"
|
55
57
|
require "ellen/robot"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Ellen::Handlers::Whoami do
|
4
|
+
let(:robot) do
|
5
|
+
Ellen::Robot.new
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "#ping" do
|
9
|
+
let(:from) do
|
10
|
+
"alice"
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:to) do
|
14
|
+
"#general"
|
15
|
+
end
|
16
|
+
|
17
|
+
let(:said) do
|
18
|
+
"@ellen Who am I?"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "returns PONG to PING" do
|
22
|
+
robot.should_receive(:say).with(
|
23
|
+
body: from,
|
24
|
+
from: to,
|
25
|
+
to: from,
|
26
|
+
original: {
|
27
|
+
body: said,
|
28
|
+
from: from,
|
29
|
+
robot: robot,
|
30
|
+
to: to,
|
31
|
+
},
|
32
|
+
)
|
33
|
+
robot.receive(body: said, from: from, to: to)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ellen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- lib/ellen/actions/base.rb
|
174
174
|
- lib/ellen/actions/help.rb
|
175
175
|
- lib/ellen/actions/ping.rb
|
176
|
+
- lib/ellen/actions/whoami.rb
|
176
177
|
- lib/ellen/adapter_builder.rb
|
177
178
|
- lib/ellen/adapters/base.rb
|
178
179
|
- lib/ellen/adapters/shell.rb
|
@@ -189,6 +190,7 @@ files:
|
|
189
190
|
- lib/ellen/handlers/base.rb
|
190
191
|
- lib/ellen/handlers/help.rb
|
191
192
|
- lib/ellen/handlers/ping.rb
|
193
|
+
- lib/ellen/handlers/whoami.rb
|
192
194
|
- lib/ellen/logger.rb
|
193
195
|
- lib/ellen/message.rb
|
194
196
|
- lib/ellen/robot.rb
|
@@ -201,6 +203,7 @@ files:
|
|
201
203
|
- spec/ellen/handlers/base_spec.rb
|
202
204
|
- spec/ellen/handlers/help_spec.rb
|
203
205
|
- spec/ellen/handlers/ping_spec.rb
|
206
|
+
- spec/ellen/handlers/whoami_spec.rb
|
204
207
|
- spec/ellen/robot_spec.rb
|
205
208
|
- spec/spec_helper.rb
|
206
209
|
- templates/Gemfile
|
@@ -237,6 +240,7 @@ test_files:
|
|
237
240
|
- spec/ellen/handlers/base_spec.rb
|
238
241
|
- spec/ellen/handlers/help_spec.rb
|
239
242
|
- spec/ellen/handlers/ping_spec.rb
|
243
|
+
- spec/ellen/handlers/whoami_spec.rb
|
240
244
|
- spec/ellen/robot_spec.rb
|
241
245
|
- spec/spec_helper.rb
|
242
246
|
has_rdoc:
|