lita 2.7.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.rubocop.yml +26 -0
- data/CONTRIBUTING.md +1 -1
- data/README.md +6 -470
- data/Rakefile +3 -3
- data/lib/lita.rb +27 -19
- data/lib/lita/adapter.rb +46 -5
- data/lib/lita/adapters/shell.rb +18 -13
- data/lib/lita/authorization.rb +1 -1
- data/lib/lita/cli.rb +37 -23
- data/lib/lita/common.rb +35 -0
- data/lib/lita/config.rb +33 -13
- data/lib/lita/daemon.rb +15 -12
- data/lib/lita/handler.rb +49 -9
- data/lib/lita/handlers/authorization.rb +47 -47
- data/lib/lita/handlers/help.rb +16 -17
- data/lib/lita/handlers/info.rb +38 -0
- data/lib/lita/handlers/room.rb +32 -0
- data/lib/lita/http_route.rb +30 -19
- data/lib/lita/message.rb +3 -6
- data/lib/lita/rack_app.rb +11 -89
- data/lib/lita/response.rb +5 -15
- data/lib/lita/robot.rb +26 -10
- data/lib/lita/rspec.rb +6 -8
- data/lib/lita/rspec/handler.rb +49 -121
- data/lib/lita/rspec/matchers/event_subscription_matcher.rb +67 -0
- data/lib/lita/rspec/matchers/http_route_matcher.rb +72 -0
- data/lib/lita/rspec/matchers/route_matcher.rb +69 -0
- data/lib/lita/source.rb +5 -18
- data/lib/lita/timer.rb +45 -0
- data/lib/lita/user.rb +51 -4
- data/lib/lita/util.rb +5 -5
- data/lib/lita/version.rb +1 -1
- data/lita.gemspec +6 -3
- data/spec/lita/adapter_spec.rb +10 -2
- data/spec/lita/adapters/shell_spec.rb +3 -3
- data/spec/lita/authorization_spec.rb +11 -11
- data/spec/lita/config_spec.rb +8 -0
- data/spec/lita/daemon_spec.rb +65 -0
- data/spec/lita/handler_spec.rb +50 -11
- data/spec/lita/handlers/authorization_spec.rb +1 -1
- data/spec/lita/handlers/info_spec.rb +31 -0
- data/spec/lita/handlers/room_spec.rb +20 -0
- data/spec/lita/logger_spec.rb +1 -1
- data/spec/lita/message_spec.rb +4 -4
- data/spec/lita/rack_app_spec.rb +92 -0
- data/spec/lita/response_spec.rb +17 -8
- data/spec/lita/robot_spec.rb +23 -14
- data/spec/lita/rspec_spec.rb +1 -1
- data/spec/lita/source_spec.rb +0 -16
- data/spec/lita/timer_spec.rb +30 -0
- data/spec/lita/user_spec.rb +66 -6
- data/spec/lita_spec.rb +37 -0
- data/spec/spec_helper.rb +11 -0
- data/templates/locales/en.yml +90 -0
- data/templates/plugin/Rakefile +1 -1
- data/templates/plugin/lib/lita/plugin_type/plugin.tt +4 -0
- data/templates/plugin/locales/en.yml.tt +4 -0
- metadata +77 -18
- data/lib/lita/handlers/web.rb +0 -25
- data/spec/lita/handlers/web_spec.rb +0 -19
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: 3.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: 2014-02-
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,48 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.8.7
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: http_router
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.11.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.11.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ice_nine
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.11.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.11.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: i18n
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.6.9
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.6.9
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: multi_json
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,47 +95,47 @@ dependencies:
|
|
53
95
|
- !ruby/object:Gem::Version
|
54
96
|
version: 1.7.7
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
98
|
+
name: puma
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
101
|
- - ">="
|
60
102
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
103
|
+
version: 2.7.1
|
62
104
|
type: :runtime
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
108
|
- - ">="
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
110
|
+
version: 2.7.1
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
112
|
+
name: rack
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - ">="
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
117
|
+
version: 1.5.2
|
76
118
|
type: :runtime
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
122
|
- - ">="
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
124
|
+
version: 1.5.2
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
126
|
+
name: redis-namespace
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
129
|
- - ">="
|
88
130
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
131
|
+
version: 1.3.0
|
90
132
|
type: :runtime
|
91
133
|
prerelease: false
|
92
134
|
version_requirements: !ruby/object:Gem::Requirement
|
93
135
|
requirements:
|
94
136
|
- - ">="
|
95
137
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
138
|
+
version: 1.3.0
|
97
139
|
- !ruby/object:Gem::Dependency
|
98
140
|
name: thor
|
99
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +170,14 @@ dependencies:
|
|
128
170
|
requirements:
|
129
171
|
- - ">="
|
130
172
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
173
|
+
version: 3.0.0.beta1
|
132
174
|
type: :development
|
133
175
|
prerelease: false
|
134
176
|
version_requirements: !ruby/object:Gem::Requirement
|
135
177
|
requirements:
|
136
178
|
- - ">="
|
137
179
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
180
|
+
version: 3.0.0.beta1
|
139
181
|
- !ruby/object:Gem::Dependency
|
140
182
|
name: simplecov
|
141
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +221,7 @@ dependencies:
|
|
179
221
|
- !ruby/object:Gem::Version
|
180
222
|
version: '0'
|
181
223
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
224
|
+
name: rubocop
|
183
225
|
requirement: !ruby/object:Gem::Requirement
|
184
226
|
requirements:
|
185
227
|
- - ">="
|
@@ -201,6 +243,7 @@ extensions: []
|
|
201
243
|
extra_rdoc_files: []
|
202
244
|
files:
|
203
245
|
- ".gitignore"
|
246
|
+
- ".rubocop.yml"
|
204
247
|
- ".travis.yml"
|
205
248
|
- CONTRIBUTING.md
|
206
249
|
- Gemfile
|
@@ -213,12 +256,14 @@ files:
|
|
213
256
|
- lib/lita/adapters/shell.rb
|
214
257
|
- lib/lita/authorization.rb
|
215
258
|
- lib/lita/cli.rb
|
259
|
+
- lib/lita/common.rb
|
216
260
|
- lib/lita/config.rb
|
217
261
|
- lib/lita/daemon.rb
|
218
262
|
- lib/lita/handler.rb
|
219
263
|
- lib/lita/handlers/authorization.rb
|
220
264
|
- lib/lita/handlers/help.rb
|
221
|
-
- lib/lita/handlers/
|
265
|
+
- lib/lita/handlers/info.rb
|
266
|
+
- lib/lita/handlers/room.rb
|
222
267
|
- lib/lita/http_route.rb
|
223
268
|
- lib/lita/logger.rb
|
224
269
|
- lib/lita/message.rb
|
@@ -227,7 +272,11 @@ files:
|
|
227
272
|
- lib/lita/robot.rb
|
228
273
|
- lib/lita/rspec.rb
|
229
274
|
- lib/lita/rspec/handler.rb
|
275
|
+
- lib/lita/rspec/matchers/event_subscription_matcher.rb
|
276
|
+
- lib/lita/rspec/matchers/http_route_matcher.rb
|
277
|
+
- lib/lita/rspec/matchers/route_matcher.rb
|
230
278
|
- lib/lita/source.rb
|
279
|
+
- lib/lita/timer.rb
|
231
280
|
- lib/lita/user.rb
|
232
281
|
- lib/lita/util.rb
|
233
282
|
- lib/lita/version.rb
|
@@ -236,20 +285,25 @@ files:
|
|
236
285
|
- spec/lita/adapters/shell_spec.rb
|
237
286
|
- spec/lita/authorization_spec.rb
|
238
287
|
- spec/lita/config_spec.rb
|
288
|
+
- spec/lita/daemon_spec.rb
|
239
289
|
- spec/lita/handler_spec.rb
|
240
290
|
- spec/lita/handlers/authorization_spec.rb
|
241
291
|
- spec/lita/handlers/help_spec.rb
|
242
|
-
- spec/lita/handlers/
|
292
|
+
- spec/lita/handlers/info_spec.rb
|
293
|
+
- spec/lita/handlers/room_spec.rb
|
243
294
|
- spec/lita/logger_spec.rb
|
244
295
|
- spec/lita/message_spec.rb
|
296
|
+
- spec/lita/rack_app_spec.rb
|
245
297
|
- spec/lita/response_spec.rb
|
246
298
|
- spec/lita/robot_spec.rb
|
247
299
|
- spec/lita/rspec_spec.rb
|
248
300
|
- spec/lita/source_spec.rb
|
301
|
+
- spec/lita/timer_spec.rb
|
249
302
|
- spec/lita/user_spec.rb
|
250
303
|
- spec/lita/util_spec.rb
|
251
304
|
- spec/lita_spec.rb
|
252
305
|
- spec/spec_helper.rb
|
306
|
+
- templates/locales/en.yml
|
253
307
|
- templates/plugin/Gemfile
|
254
308
|
- templates/plugin/LICENSE.tt
|
255
309
|
- templates/plugin/README.tt
|
@@ -258,6 +312,7 @@ files:
|
|
258
312
|
- templates/plugin/gitignore
|
259
313
|
- templates/plugin/lib/lita/plugin_type/plugin.tt
|
260
314
|
- templates/plugin/lib/plugin.tt
|
315
|
+
- templates/plugin/locales/en.yml.tt
|
261
316
|
- templates/plugin/spec/lita/plugin_type/plugin_spec.tt
|
262
317
|
- templates/plugin/spec/spec_helper.tt
|
263
318
|
- templates/plugin/travis.yml
|
@@ -283,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
338
|
version: '0'
|
284
339
|
requirements: []
|
285
340
|
rubyforge_project:
|
286
|
-
rubygems_version: 2.2.
|
341
|
+
rubygems_version: 2.2.2
|
287
342
|
signing_key:
|
288
343
|
specification_version: 4
|
289
344
|
summary: A multi-service chat bot with extendable behavior.
|
@@ -292,16 +347,20 @@ test_files:
|
|
292
347
|
- spec/lita/adapters/shell_spec.rb
|
293
348
|
- spec/lita/authorization_spec.rb
|
294
349
|
- spec/lita/config_spec.rb
|
350
|
+
- spec/lita/daemon_spec.rb
|
295
351
|
- spec/lita/handler_spec.rb
|
296
352
|
- spec/lita/handlers/authorization_spec.rb
|
297
353
|
- spec/lita/handlers/help_spec.rb
|
298
|
-
- spec/lita/handlers/
|
354
|
+
- spec/lita/handlers/info_spec.rb
|
355
|
+
- spec/lita/handlers/room_spec.rb
|
299
356
|
- spec/lita/logger_spec.rb
|
300
357
|
- spec/lita/message_spec.rb
|
358
|
+
- spec/lita/rack_app_spec.rb
|
301
359
|
- spec/lita/response_spec.rb
|
302
360
|
- spec/lita/robot_spec.rb
|
303
361
|
- spec/lita/rspec_spec.rb
|
304
362
|
- spec/lita/source_spec.rb
|
363
|
+
- spec/lita/timer_spec.rb
|
305
364
|
- spec/lita/user_spec.rb
|
306
365
|
- spec/lita/util_spec.rb
|
307
366
|
- spec/lita_spec.rb
|
data/lib/lita/handlers/web.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
module Lita
|
2
|
-
module Handlers
|
3
|
-
# Provides an HTTP route with basic information about the running robot.
|
4
|
-
class Web < Handler
|
5
|
-
http.get "/lita/info", :info
|
6
|
-
|
7
|
-
# Returns JSON with basic information about the robot.
|
8
|
-
# @param request [Rack::Request] The HTTP request.
|
9
|
-
# @param response [Rack::Response] The HTTP response.
|
10
|
-
# @return [void]
|
11
|
-
def info(request, response)
|
12
|
-
response.headers["Content-Type"] = "application/json"
|
13
|
-
json = MultiJson.dump(
|
14
|
-
lita_version: Lita::VERSION,
|
15
|
-
adapter: Lita.config.robot.adapter,
|
16
|
-
robot_name: robot.name,
|
17
|
-
robot_mention_name: robot.mention_name
|
18
|
-
)
|
19
|
-
response.write(json)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
Lita.register_handler(Web)
|
24
|
-
end
|
25
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Lita::Handlers::Web, lita_handler: true do
|
4
|
-
it { routes_http(:get, "/lita/info").to(:info) }
|
5
|
-
it { doesnt_route_http(:post, "/lita/info").to(:info) }
|
6
|
-
|
7
|
-
let(:request) { double("Rack::Request") }
|
8
|
-
let(:response) { Rack::Response.new }
|
9
|
-
|
10
|
-
describe "#info" do
|
11
|
-
it "returns JSON with info about the running robot" do
|
12
|
-
subject.info(request, response)
|
13
|
-
expect(response.headers["Content-Type"]).to eq("application/json")
|
14
|
-
expect(response.body.join).to include(
|
15
|
-
%{"lita_version":"#{Lita::VERSION}"}
|
16
|
-
)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|