-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
47 lines (39 loc) · 878 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
36
37
38
39
40
41
42
43
44
45
46
47
require 'rake/testtask'
require 'rake/rdoctask'
def command?(command)
system("type #{command} > /dev/null")
end
#
# Tests
#
task :default => :test
if command? :turn
desc "Run tests"
task :test do
suffix = "-n #{ENV['TEST']}" if ENV['TEST']
sh "turn test/*_test.rb #{suffix}"
end
else
Rake::TestTask.new do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
end
#
# Gems
#
begin
require 'mg'
MG.new("resque-result.gemspec")
rescue LoadError
warn "mg not available."
warn "Install it with: gem i mg"
end
desc "Tag and publish a new version to Rubygems"
task :publish => [ :test, 'gem:publish' ] do
require 'lib/resque/plugins/result/version'
sh ["git tag v#{Resque::Plugins::Result::Version}",
"git push origin v#{Resque::Plugins::Result::Version}",
"git push origin master"].join(' && ')
end