lita 4.3.1 → 4.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/adapters/shell.rb +2 -1
- data/lib/lita/version.rb +1 -1
- data/spec/lita/adapters/shell_spec.rb +15 -0
- data/templates/plugin/gemspec.tt +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bdd0419bd6701e21efff584a64c111fc1459f61
|
4
|
+
data.tar.gz: b5344ba16def3e3f64436bbc8530de08874cc5c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09897b35e777fd74d4f9a340dd08a079795458e6ac5f2ddb0f6886003a449a0144b461c312e7108a9bf2919b935106bd463a99a877ce962af38a04e4cfbe953e
|
7
|
+
data.tar.gz: 48dbf19395304d6fbee73486ce28992bb8bc4b2c16b6a728f342c3c0035438a0bb98c9dc2637605f5ca9f08e05e56dde34acb0c713a4f4e9d082e702f9d1f7ac
|
data/lib/lita/adapters/shell.rb
CHANGED
@@ -10,7 +10,8 @@ module Lita
|
|
10
10
|
# @return [void]
|
11
11
|
def run
|
12
12
|
user = User.create(1, name: "Shell User")
|
13
|
-
|
13
|
+
room = robot.config.adapters.shell.private_chat ? nil : "shell"
|
14
|
+
@source = Source.new(user: user, room: room)
|
14
15
|
puts t("startup_message")
|
15
16
|
robot.trigger(:connected)
|
16
17
|
|
data/lib/lita/version.rb
CHANGED
@@ -14,12 +14,15 @@ describe Lita::Adapters::Shell, lita: true do
|
|
14
14
|
subject { described_class.new(robot) }
|
15
15
|
|
16
16
|
describe "#run" do
|
17
|
+
let(:user) { Lita::User.create(1, name: "Shell User") }
|
18
|
+
|
17
19
|
before do
|
18
20
|
registry.register_adapter(:shell, described_class)
|
19
21
|
allow(subject).to receive(:puts)
|
20
22
|
allow(Readline).to receive(:readline).and_return("foo", "exit")
|
21
23
|
allow(robot).to receive(:trigger)
|
22
24
|
allow(robot).to receive(:receive)
|
25
|
+
allow(Lita::User).to receive(:create).and_return(user)
|
23
26
|
end
|
24
27
|
|
25
28
|
it "passes input to the Robot and breaks on an exit message" do
|
@@ -34,6 +37,18 @@ describe Lita::Adapters::Shell, lita: true do
|
|
34
37
|
subject.run
|
35
38
|
end
|
36
39
|
|
40
|
+
it "sets the room to 'shell' if config.adapters.shell.private_chat is false" do
|
41
|
+
registry.config.adapters.shell.private_chat = false
|
42
|
+
expect(Lita::Source).to receive(:new).with(user: user, room: "shell")
|
43
|
+
subject.run
|
44
|
+
end
|
45
|
+
|
46
|
+
it "sets the room to nil if config.adapters.shell.private_chat is true" do
|
47
|
+
registry.config.adapters.shell.private_chat = true
|
48
|
+
expect(Lita::Source).to receive(:new).with(user: user, room: nil)
|
49
|
+
subject.run
|
50
|
+
end
|
51
|
+
|
37
52
|
it "triggers a connected event" do
|
38
53
|
expect(robot).to receive(:trigger).with(:connected)
|
39
54
|
subject.run
|
data/templates/plugin/gemspec.tt
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Cuadra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|