-
Notifications
You must be signed in to change notification settings - Fork 25
/
Rakefile
42 lines (35 loc) · 1.33 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
require "rake/clean"
CLEAN.include %w'**.rbc rdoc coverage'
desc "Do a full cleaning"
task :distclean do
CLEAN.include %w'tmp pkg sequel_pg*.gem lib/*.so'
Rake::Task[:clean].invoke
end
desc "Build the gem"
task :gem do
sh %{gem build sequel_pg.gemspec}
end
begin
require 'rake/extensiontask'
Rake::ExtensionTask.new('sequel_pg')
rescue LoadError
end
# This assumes you have sequel checked out in ../sequel, and that
# spec_postgres is setup to run Sequel's PostgreSQL specs.
desc "Run tests with coverage"
task :spec_cov=>:compile do
ENV['RUBYLIB'] = "#{__dir__}/lib:#{ENV['RUBYLIB']}"
ENV['RUBYOPT'] = "-r #{__dir__}/spec/coverage_helper.rb #{ENV['RUBYOPT']}"
ENV['SIMPLECOV_COMMAND_NAME'] = "sequel_pg"
sh %'#{FileUtils::RUBY} -I ../sequel/lib spec/sequel_pg_spec.rb'
ENV['RUBYOPT'] = "-I lib -r sequel -r sequel/extensions/pg_array #{ENV['RUBYOPT']}"
ENV['SEQUEL_PG_STREAM'] = "1"
ENV['SIMPLECOV_COMMAND_NAME'] = "sequel"
sh %'cd ../sequel && #{FileUtils::RUBY} spec/adapter_spec.rb postgres'
end
desc "Run CI tests"
task :spec_ci=>:compile do
ENV['SEQUEL_PG_SPEC_URL'] = ENV['SEQUEL_POSTGRES_URL'] = "postgres://localhost/?user=postgres&password=postgres"
sh %'#{FileUtils::RUBY} -I lib -I sequel/lib spec/sequel_pg_spec.rb'
sh %'cd sequel && #{FileUtils::RUBY} -I lib -I ../lib spec/adapter_spec.rb postgres'
end