forked from pilotcreative/vote_fu
-
Notifications
You must be signed in to change notification settings - Fork 75
/
Rakefile
46 lines (39 loc) · 1.06 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
# encoding: UTF-8
require 'rubygems'
require 'bundler' unless defined?(Bundler)
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require 'thumbs_up/version'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.test_files = Dir.glob("test/**/*_test.rb")
test.verbose = true
end
task :build do
system "gem build thumbs_up.gemspec"
end
task :release => :build do
system "gem push thumbs_up-#{ThumbsUp::VERSION}.gem"
system "rm thumbs_up-#{ThumbsUp::VERSION}.gem"
end
task :test_all_databases do
# Test MySQL, Postgres and SQLite3
ENV['DB'] = 'mysql'
puts "Testing MySQL..."
Rake::Task['test'].execute
ENV['DB'] = 'postgres'
puts "Testing Postgres..."
Rake::Task['test'].execute
ENV['DB'] = 'sqlite3'
puts "Testing SQLite3..."
Rake::Task['test'].execute
end
task :default => :test_all_databases