forked from resque/resque-loner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
55 lines (45 loc) · 1.03 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
$LOAD_PATH.unshift 'lib'
require 'rubygems'
require 'bundler'
Bundler.setup
require 'rspec/core/rake_task'
load 'tasks/redis.rake'
require 'rake/testtask'
require 'resque/tasks'
require 'bundler/gem_tasks'
require 'rubocop/rake_task'
def command?(command)
system("type #{command} > /dev/null 2>&1")
end
task default: [:rubocop, :spec]
Rubocop::RakeTask.new
desc 'Run specs for resque-loner'
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rspec_opts = %w(-fd -c)
end
if command?(:rg)
desc 'Run the test suite with rg'
task :test do
Dir['test/**/*_test.rb'].each do |f|
sh("rg #{f}")
end
end
else
Rake::TestTask.new do |test|
test.libs << 'test'
test.test_files = FileList['test/**/*_test.rb']
end
end
if command? :kicker
desc 'Launch Kicker (like autotest)'
task :kicker do
puts 'Kicking... (ctrl+c to cancel)'
exec 'kicker -e rake test lib examples'
end
end
task :install => ['redis:install', 'dtach:install']
begin
require 'sdoc_helpers'
rescue LoadError
end