forked from redis-store/redis-store
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
57 lines (49 loc) · 1.52 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$:.unshift 'lib'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'spec/rake/spectask'
task :default => "spec:suite"
begin
require "jeweler"
Jeweler::Tasks.new do |gemspec|
gemspec.name = "redis-store"
gemspec.summary = "Rack::Session, Rack::Cache and cache Redis stores for Ruby web frameworks."
gemspec.description = "Rack::Session, Rack::Cache and cache Redis stores for Ruby web frameworks."
gemspec.email = "[email protected]"
gemspec.homepage = "http://github.com/jodosha/redis-store"
gemspec.authors = [ "Luca Guidi" ]
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install jeweler"
end
namespace :spec do
desc "Run all the examples by starting a detached Redis instance"
task :suite do
invoke_with_redis_cluster "spec:run"
end
Spec::Rake::SpecTask.new(:run) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = %w(-fs --color)
end
end
desc "Run all examples with RCov"
task :rcov do
invoke_with_redis_cluster "rcov_run"
end
Spec::Rake::SpecTask.new(:rcov_run) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
end
# courtesy of http://github.com/ezmobius/redis-rb team
load "tasks/redis.tasks.rb"
def invoke_with_redis_cluster(task_name)
begin
result = RedisClusterRunner.start_detached
raise("Could not start redis-server, aborting.") unless result
Rake::Task[task_name].invoke
ensure
RedisClusterRunner.stop
end
end