lita 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita.rb +10 -6
- data/lib/lita/errors.rb +4 -0
- data/lib/lita/version.rb +1 -1
- data/spec/lita_spec.rb +17 -3
- data/templates/locales/en.yml +3 -0
- 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: 21f001a7ad45ff1f2e3a87b07a5eecdc94c27669
|
4
|
+
data.tar.gz: 8e1369a2294bc07f39f0a360daa1b07ba4d4d3d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19cb7bc31c045032d5dad49affce04967068ad982288ac63b10374542ad81364daba7fbde3ac2e1d71231b42bc8722e0fcb7d2229f3173b91c22993d95d999f3
|
7
|
+
data.tar.gz: 1ab1fd0f6b5b81bd1193dfcd2793a15279fb790211988aa6261870a793768f70e7db3ce46923548c27306c173532ac0fc84545ce5bcb4b596281ef05ed211008
|
data/lib/lita.rb
CHANGED
@@ -52,12 +52,16 @@ module Lita
|
|
52
52
|
begin
|
53
53
|
client.ping
|
54
54
|
rescue Redis::BaseError => e
|
55
|
-
Lita.
|
56
|
-
"lita.redis.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
if Lita.test_mode?
|
56
|
+
raise RedisError, I18n.t("lita.redis.test_mode_exception", message: e.message)
|
57
|
+
else
|
58
|
+
Lita.logger.fatal I18n.t(
|
59
|
+
"lita.redis.exception",
|
60
|
+
message: e.message,
|
61
|
+
backtrace: e.backtrace.join("\n")
|
62
|
+
)
|
63
|
+
abort
|
64
|
+
end
|
61
65
|
end
|
62
66
|
end
|
63
67
|
end
|
data/lib/lita/errors.rb
CHANGED
data/lib/lita/version.rb
CHANGED
data/spec/lita_spec.rb
CHANGED
@@ -75,11 +75,25 @@ describe Lita do
|
|
75
75
|
expect(described_class.redis).to eql(described_class.redis)
|
76
76
|
end
|
77
77
|
|
78
|
-
it "
|
78
|
+
it "raises a RedisError if it can't connect to Redis" do
|
79
79
|
allow(redis_namespace).to receive(:ping).and_raise(Redis::CannotConnectError)
|
80
|
+
expect { Lita.redis }.to raise_error(Lita::RedisError, /could not connect to Redis/)
|
81
|
+
end
|
82
|
+
|
83
|
+
context "with test mode off" do
|
84
|
+
around do |example|
|
85
|
+
test_mode = Lita.test_mode?
|
86
|
+
Lita.test_mode = false
|
87
|
+
example.run
|
88
|
+
Lita.test_mode = test_mode
|
89
|
+
end
|
80
90
|
|
81
|
-
|
82
|
-
|
91
|
+
it "logs a fatal warning and raises an exception if it can't connect to Redis" do
|
92
|
+
allow(redis_namespace).to receive(:ping).and_raise(Redis::CannotConnectError)
|
93
|
+
|
94
|
+
expect(Lita.logger).to receive(:fatal)
|
95
|
+
expect { Lita.redis }.to raise_error(SystemExit)
|
96
|
+
end
|
83
97
|
end
|
84
98
|
end
|
85
99
|
|
data/templates/locales/en.yml
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.0.
|
4
|
+
version: 4.0.3
|
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-
|
11
|
+
date: 2014-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|