-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
35 lines (27 loc) · 782 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "yard"
RSpec::Core::RakeTask.new(:spec)
YARD::Rake::YardocTask.new(:doc)
task default: :spec
desc "Run a REPL with access to this library"
task :console do
sh("irb -I lib -r super_spreader")
end
namespace :check do
desc "Run all checks"
task all: %i[redis]
desc "Confirm Redis is accessible"
task :redis do
require "redis"
inaccessible_error_message = "Redis: inaccessible (please confirm that a Redis server is installed and running, e.g. redis-server)"
redis = Redis.new(url: ENV["REDIS_URL"])
if redis.ping == "PONG"
puts "Redis: OK"
else
raise inaccessible_error_message
end
rescue Redis::CannotConnectError
raise inaccessible_error_message
end
end