some more rspec2 changes, organize rake tasks

This commit is contained in:
Brian Lopez 2010-10-17 16:51:14 -07:00
parent 0a7e7ee475
commit 22c9ff48a8
4 changed files with 35 additions and 38 deletions

View File

@ -1,42 +1,5 @@
# encoding: UTF-8
begin
require 'jeweler'
JEWELER = Jeweler::Tasks.new do |gem|
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")
gem.extensions = ["ext/mysql2/extconf.rb"]
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
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'
t.verbose = true
t.warning = true
end
task :default => :spec
# Load custom tasks
Dir['tasks/*.rake'].sort.each { |f| load f }

View File

@ -1,6 +1,7 @@
# encoding: UTF-8
require 'rubygems'
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require 'rspec'
require 'mysql2'
require 'timeout'

17
tasks/jeweler.rake Normal file
View File

@ -0,0 +1,17 @@
begin
require 'jeweler'
JEWELER = Jeweler::Tasks.new do |gem|
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")
gem.extensions = ["ext/mysql2/extconf.rb"]
gem.files.include %w(lib/jeweler/templates/.document lib/jeweler/templates/.gitignore)
end
rescue LoadError
puts "jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
end

16
tasks/rspec.rake Normal file
View File

@ -0,0 +1,16 @@
begin
require 'rspec'
require 'rspec/core/rake_task'
desc "Run all examples with RCov"
RSpec::Core::RakeTask.new('spec:rcov') do |t|
t.rcov = true
end
RSpec::Core::RakeTask.new('spec') do |t|
t.verbose = true
end
task :default => :spec
rescue LoadError
puts "rspec, or one of its dependencies, is not available. Install it with: sudo gem install rspec"
end