forked from bkeepers/qu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
50 lines (41 loc) · 1.11 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
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "qu/version"
desc 'Build gem into the pkg directory'
task :build do
FileUtils.rm_rf('pkg')
Dir['*.gemspec'].each do |gemspec|
system "gem build #{gemspec}"
end
FileUtils.mkdir_p('pkg')
FileUtils.mv(Dir['*.gem'], 'pkg')
end
desc 'Tags version, pushes to remote, and pushes gem'
task :release => :build do
sh 'git', 'tag', '-m', changelog, "v#{Qu::VERSION}"
sh "git push origin master"
sh "git push origin v#{Qu::VERSION}"
sh "ls pkg/*.gem | xargs -n 1 gem push"
end
require 'rspec/core/rake_task'
desc "Run all specs"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--color]
t.verbose = false
end
namespace :spec do
Backends = %w(mongo redis)
Backends.each do |backend|
desc "Run specs for #{backend} backend"
RSpec::Core::RakeTask.new(backend) do |t|
t.rspec_opts = %w[--color]
t.verbose = false
t.pattern = "spec/qu/backend/#{backend}_spec.rb"
end
end
task :backends => Backends
end
def changelog
File.read('ChangeLog').split("\n\n\n", 2).first
end
task :default => :spec