burninator 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/burninator.rb +4 -2
- metadata +1 -1
data/lib/burninator.rb
CHANGED
@@ -6,6 +6,8 @@ require "burninator/tasks"
|
|
6
6
|
class Burninator
|
7
7
|
DEFAULT_PERCENTAGE = 5
|
8
8
|
|
9
|
+
EnvironmentError = Class.new(ArgumentError)
|
10
|
+
|
9
11
|
def initialize(options = {})
|
10
12
|
@redis = options[:redis]
|
11
13
|
@percentage = options.fetch(:percentage, DEFAULT_PERCENTAGE)
|
@@ -47,14 +49,14 @@ class Burninator
|
|
47
49
|
def warm_target_url
|
48
50
|
ENV.fetch("WARM_TARGET_URL")
|
49
51
|
rescue KeyError
|
50
|
-
raise
|
52
|
+
raise EnvironmentError,
|
51
53
|
"To use burninator, set WARM_TARGET_URL in your environment. See https://github.com/jpignata/burninator for more details."
|
52
54
|
end
|
53
55
|
|
54
56
|
def redis_url
|
55
57
|
ENV.fetch("REDIS_URL")
|
56
58
|
rescue KeyError
|
57
|
-
raise
|
59
|
+
raise EnvironmentError,
|
58
60
|
"To use burninator, set REDIS_URL in your environment. See https://github.com/jpignata/burninator for more details."
|
59
61
|
end
|
60
62
|
end
|