2010-03-30 16:56:24 +00:00
|
|
|
# encoding: UTF-8
|
2010-04-04 20:13:42 +00:00
|
|
|
begin
|
|
|
|
require 'jeweler'
|
2010-06-30 00:06:39 +00:00
|
|
|
JEWELER = Jeweler::Tasks.new do |gem|
|
2010-04-04 20:13:42 +00:00
|
|
|
gem.name = "mysql2"
|
|
|
|
gem.summary = "A simple, fast Mysql library for Ruby, binding to libmysql"
|
|
|
|
gem.email = "seniorlopez@gmail.com"
|
|
|
|
gem.homepage = "http://github.com/brianmario/mysql2"
|
|
|
|
gem.authors = ["Brian Lopez"]
|
|
|
|
gem.require_paths = ["lib", "ext"]
|
|
|
|
gem.extra_rdoc_files = `git ls-files *.rdoc`.split("\n")
|
|
|
|
gem.files = `git ls-files`.split("\n")
|
2010-06-30 00:06:39 +00:00
|
|
|
gem.extensions = ["ext/mysql2/extconf.rb"]
|
2010-04-04 20:13:42 +00:00
|
|
|
gem.files.include %w(lib/jeweler/templates/.document lib/jeweler/templates/.gitignore)
|
|
|
|
# gem.rubyforge_project = "mysql2"
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler -s http://gems.github.com"
|
|
|
|
end
|
2010-03-30 16:56:24 +00:00
|
|
|
|
|
|
|
require 'rake'
|
|
|
|
require 'spec/rake/spectask'
|
|
|
|
|
|
|
|
desc "Run all examples with RCov"
|
|
|
|
Spec::Rake::SpecTask.new('spec:rcov') do |t|
|
|
|
|
t.spec_files = FileList['spec/']
|
|
|
|
t.rcov = true
|
|
|
|
t.rcov_opts = lambda do
|
|
|
|
IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Spec::Rake::SpecTask.new('spec') do |t|
|
|
|
|
t.spec_files = FileList['spec/']
|
|
|
|
t.spec_opts << '--options' << 'spec/spec.opts'
|
2010-06-30 00:06:39 +00:00
|
|
|
end
|
|
|
|
|
2010-08-06 22:54:24 +00:00
|
|
|
task :default => :spec
|
|
|
|
|
2010-08-06 23:01:35 +00:00
|
|
|
def define_bench_task(feature)
|
|
|
|
desc "Run #{feature} benchmarks"
|
|
|
|
task(feature){ ruby "benchmark/#{feature}.rb" }
|
|
|
|
end
|
|
|
|
|
|
|
|
namespace :bench do
|
|
|
|
define_bench_task :active_record
|
|
|
|
define_bench_task :escape
|
|
|
|
define_bench_task :query_with_mysql_casting
|
|
|
|
define_bench_task :query_without_mysql_casting
|
|
|
|
define_bench_task :sequel
|
2010-08-08 22:02:28 +00:00
|
|
|
define_bench_task :allocations
|
2010-08-08 22:49:44 +00:00
|
|
|
define_bench_task :thread_alone
|
|
|
|
end# Load custom tasks
|
2010-08-11 15:40:55 +00:00
|
|
|
Dir['tasks/*.rake'].sort.each { |f| load f }
|