-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathRakefile
41 lines (33 loc) · 777 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
$LOAD_PATH.unshift 'helpers'
$LOAD_PATH.unshift 'lib'
#
# Setup
#
require 'bundler/gem_tasks'
require 'resque/tasks'
require 'resque_job'
def command?(command)
system("type #{command} > /dev/null 2>&1")
end
#
# Tests
#
task :default => :test
desc "Run the test suite"
task :test do
rg = command?(:rg)
Dir['test/**/*_test.rb'].each do |f|
rg ? sh("rg #{f}") : ruby(f)
end
end
desc "Bump version"
task :git_tag_version do
require 'resque-sliders/version'
git_tags = `git tag -l`.split.map { |x| x.gsub(/v/, '') }
version = Resque::Plugins::ResqueSliders::Version
commit_sha = `git log -1 HEAD|head -n1|awk '{print $2}'`
unless git_tags.include?(version)
(puts version, commit_sha; `git tag v#{version} #{commit_sha}`)
`rake build`
end
end