lita 1.1.2 → 2.0.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 +202 -45
- data/lib/lita.rb +45 -24
- data/lib/lita/adapter.rb +35 -0
- data/lib/lita/adapters/shell.rb +14 -3
- data/lib/lita/authorization.rb +24 -0
- data/lib/lita/cli.rb +1 -0
- data/lib/lita/config.rb +52 -19
- data/lib/lita/handler.rb +100 -36
- data/lib/lita/handlers/authorization.rb +38 -27
- data/lib/lita/handlers/help.rb +25 -22
- data/lib/lita/handlers/web.rb +25 -0
- data/lib/lita/http_route.rb +64 -0
- data/lib/lita/logger.rb +34 -0
- data/lib/lita/message.rb +41 -7
- data/lib/lita/rack_app_builder.rb +110 -0
- data/lib/lita/response.rb +30 -0
- data/lib/lita/robot.rb +56 -1
- data/lib/lita/rspec.rb +23 -50
- data/lib/lita/rspec/handler.rb +168 -0
- data/lib/lita/source.rb +19 -1
- data/lib/lita/user.rb +37 -1
- data/lib/lita/util.rb +26 -0
- data/lib/lita/version.rb +2 -1
- data/lita.gemspec +5 -0
- data/spec/lita/adapters/shell_spec.rb +12 -4
- data/spec/lita/config_spec.rb +18 -2
- data/spec/lita/handler_spec.rb +43 -46
- data/spec/lita/handlers/authorization_spec.rb +24 -31
- data/spec/lita/handlers/help_spec.rb +10 -8
- data/spec/lita/handlers/web_spec.rb +19 -0
- data/spec/lita/logger_spec.rb +26 -0
- data/spec/lita/message_spec.rb +16 -11
- data/spec/lita/robot_spec.rb +25 -2
- data/spec/lita/rspec_spec.rb +32 -20
- data/spec/lita/util_spec.rb +9 -0
- data/spec/lita_spec.rb +0 -51
- data/spec/spec_helper.rb +2 -1
- metadata +85 -3
- data/CHANGELOG.md +0 -21
data/spec/lita_spec.rb
CHANGED
@@ -1,28 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Lita do
|
4
|
-
before do
|
5
|
-
Lita.instance_variable_set(:@config, nil)
|
6
|
-
Lita.instance_variable_set(:@logger, nil)
|
7
|
-
end
|
8
|
-
|
9
|
-
it "memoizes a hash of Adapters" do
|
10
|
-
adapter_class = double("Adapter")
|
11
|
-
described_class.register_adapter(:foo, adapter_class)
|
12
|
-
expect(described_class.adapters[:foo]).to eql(adapter_class)
|
13
|
-
expect(described_class.adapters).to eql(described_class.adapters)
|
14
|
-
end
|
15
|
-
|
16
|
-
it "memoizes a set of Handlers" do
|
17
|
-
handler_class = double("Handler")
|
18
|
-
described_class.register_handler(handler_class)
|
19
|
-
described_class.register_handler(handler_class)
|
20
|
-
original_size = described_class.handlers.to_a.size
|
21
|
-
new_size = (described_class.handlers.to_a - [handler_class]).size
|
22
|
-
expect(new_size).to eq(original_size - 1)
|
23
|
-
expect(described_class.handlers).to eql(described_class.handlers)
|
24
|
-
end
|
25
|
-
|
26
4
|
it "memoizes a Config" do
|
27
5
|
expect(described_class.config).to be_a(Lita::Config)
|
28
6
|
expect(described_class.config).to eql(described_class.config)
|
@@ -35,35 +13,6 @@ describe Lita do
|
|
35
13
|
end
|
36
14
|
end
|
37
15
|
|
38
|
-
describe ".logger" do
|
39
|
-
it "memoizes the logger" do
|
40
|
-
expect(described_class.logger).to be_a(Logger)
|
41
|
-
expect(described_class.logger).to eql(described_class.logger)
|
42
|
-
end
|
43
|
-
|
44
|
-
it "uses a custom log level" do
|
45
|
-
Lita.config.robot.log_level = :debug
|
46
|
-
expect(described_class.logger.level).to eq(Logger::DEBUG)
|
47
|
-
end
|
48
|
-
|
49
|
-
it "uses the info level if the config is nil" do
|
50
|
-
Lita.config.robot.log_level = nil
|
51
|
-
expect(described_class.logger.level).to eq(Logger::INFO)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "uses the info level if the config level is invalid" do
|
55
|
-
Lita.config.robot.log_level = :foo
|
56
|
-
expect(described_class.logger.level).to eq(Logger::INFO)
|
57
|
-
end
|
58
|
-
|
59
|
-
it "logs messages with a custom format" do
|
60
|
-
stderr = StringIO.new
|
61
|
-
stub_const("STDERR", stderr)
|
62
|
-
Lita.logger.fatal "foo"
|
63
|
-
expect(stderr.string).to match(%r{^\[.+\] FATAL: foo$})
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
16
|
describe ".redis" do
|
68
17
|
it "memoizes a Redis::Namespace" do
|
69
18
|
expect(described_class.redis).to respond_to(:namespace)
|
data/spec/spec_helper.rb
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
|
+
version: 2.0.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-06
|
11
|
+
date: 2013-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,48 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.7
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.7
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: multi_json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.7.7
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.7.7
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rack
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.5.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.5.2
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: redis-namespace
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +80,20 @@ dependencies:
|
|
38
80
|
- - ~>
|
39
81
|
- !ruby/object:Gem::Version
|
40
82
|
version: 1.3.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: thin
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.5.1
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.5.1
|
41
97
|
- !ruby/object:Gem::Dependency
|
42
98
|
name: thor
|
43
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +164,20 @@ dependencies:
|
|
108
164
|
- - '>='
|
109
165
|
- !ruby/object:Gem::Version
|
110
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
111
181
|
description: A multi-service chat bot with extendable behavior.
|
112
182
|
email:
|
113
183
|
- jimmy@jimmycuadra.com
|
@@ -118,7 +188,6 @@ extra_rdoc_files: []
|
|
118
188
|
files:
|
119
189
|
- .gitignore
|
120
190
|
- .travis.yml
|
121
|
-
- CHANGELOG.md
|
122
191
|
- Gemfile
|
123
192
|
- README.md
|
124
193
|
- Rakefile
|
@@ -132,11 +201,18 @@ files:
|
|
132
201
|
- lib/lita/handler.rb
|
133
202
|
- lib/lita/handlers/authorization.rb
|
134
203
|
- lib/lita/handlers/help.rb
|
204
|
+
- lib/lita/handlers/web.rb
|
205
|
+
- lib/lita/http_route.rb
|
206
|
+
- lib/lita/logger.rb
|
135
207
|
- lib/lita/message.rb
|
208
|
+
- lib/lita/rack_app_builder.rb
|
209
|
+
- lib/lita/response.rb
|
136
210
|
- lib/lita/robot.rb
|
137
211
|
- lib/lita/rspec.rb
|
212
|
+
- lib/lita/rspec/handler.rb
|
138
213
|
- lib/lita/source.rb
|
139
214
|
- lib/lita/user.rb
|
215
|
+
- lib/lita/util.rb
|
140
216
|
- lib/lita/version.rb
|
141
217
|
- lita.gemspec
|
142
218
|
- skeleton/Gemfile
|
@@ -148,11 +224,14 @@ files:
|
|
148
224
|
- spec/lita/handler_spec.rb
|
149
225
|
- spec/lita/handlers/authorization_spec.rb
|
150
226
|
- spec/lita/handlers/help_spec.rb
|
227
|
+
- spec/lita/handlers/web_spec.rb
|
228
|
+
- spec/lita/logger_spec.rb
|
151
229
|
- spec/lita/message_spec.rb
|
152
230
|
- spec/lita/robot_spec.rb
|
153
231
|
- spec/lita/rspec_spec.rb
|
154
232
|
- spec/lita/source_spec.rb
|
155
233
|
- spec/lita/user_spec.rb
|
234
|
+
- spec/lita/util_spec.rb
|
156
235
|
- spec/lita_spec.rb
|
157
236
|
- spec/spec_helper.rb
|
158
237
|
homepage: https://github.com/jimmycuadra/lita
|
@@ -187,11 +266,14 @@ test_files:
|
|
187
266
|
- spec/lita/handler_spec.rb
|
188
267
|
- spec/lita/handlers/authorization_spec.rb
|
189
268
|
- spec/lita/handlers/help_spec.rb
|
269
|
+
- spec/lita/handlers/web_spec.rb
|
270
|
+
- spec/lita/logger_spec.rb
|
190
271
|
- spec/lita/message_spec.rb
|
191
272
|
- spec/lita/robot_spec.rb
|
192
273
|
- spec/lita/rspec_spec.rb
|
193
274
|
- spec/lita/source_spec.rb
|
194
275
|
- spec/lita/user_spec.rb
|
276
|
+
- spec/lita/util_spec.rb
|
195
277
|
- spec/lita_spec.rb
|
196
278
|
- spec/spec_helper.rb
|
197
279
|
has_rdoc:
|
data/CHANGELOG.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
## 1.1.2 (June 23, 2013)
|
4
|
-
|
5
|
-
* Fixed a bug where User objects would raise an exception when compared against non-User objects.
|
6
|
-
|
7
|
-
## 1.1.1 (June 23, 2013)
|
8
|
-
|
9
|
-
* Fixed broken internals in the authorization API. Auth commands will now correctly detect the user making the command and will normalize group names so that capitalization and white space don't matter.
|
10
|
-
|
11
|
-
## 1.1.0 (June 23, 2013)
|
12
|
-
|
13
|
-
* Added a new configuration: `config.robot.mention_name`. This allows the display name of the robot `config.robot.name` to differ from the name Lita uses to detect a message as a command. For example, on HipChat, Lita's name might be displayed as "Lita Bot", but might be mentioned in messages with "LitaBot". This value will default to `config.robot.name` if not set.
|
14
|
-
|
15
|
-
## 1.0.0 (June 22, 2013)
|
16
|
-
|
17
|
-
First stable release.
|
18
|
-
|
19
|
-
## 0.0.1 (June 15, 2013)
|
20
|
-
|
21
|
-
Initial release.
|