Skip to content

Commit 22c9ff4

Browse files
committed
some more rspec2 changes, organize rake tasks
1 parent 0a7e7ee commit 22c9ff4

File tree

4 files changed

+35
-38
lines changed

4 files changed

+35
-38
lines changed

Rakefile

-37
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,5 @@
11
# encoding: UTF-8
2-
begin
3-
require 'jeweler'
4-
JEWELER = Jeweler::Tasks.new do |gem|
5-
gem.name = "mysql2"
6-
gem.summary = "A simple, fast Mysql library for Ruby, binding to libmysql"
7-
gem.email = "[email protected]"
8-
gem.homepage = "http://github.com/brianmario/mysql2"
9-
gem.authors = ["Brian Lopez"]
10-
gem.require_paths = ["lib", "ext"]
11-
gem.extra_rdoc_files = `git ls-files *.rdoc`.split("\n")
12-
gem.files = `git ls-files`.split("\n")
13-
gem.extensions = ["ext/mysql2/extconf.rb"]
14-
gem.files.include %w(lib/jeweler/templates/.document lib/jeweler/templates/.gitignore)
15-
# gem.rubyforge_project = "mysql2"
16-
end
17-
rescue LoadError
18-
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler -s http://gems.github.com"
19-
end
20-
212
require 'rake'
22-
require 'spec/rake/spectask'
23-
24-
desc "Run all examples with RCov"
25-
Spec::Rake::SpecTask.new('spec:rcov') do |t|
26-
t.spec_files = FileList['spec/']
27-
t.rcov = true
28-
t.rcov_opts = lambda do
29-
IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
30-
end
31-
end
32-
Spec::Rake::SpecTask.new('spec') do |t|
33-
t.spec_files = FileList['spec/']
34-
t.spec_opts << '--options' << 'spec/spec.opts'
35-
t.verbose = true
36-
t.warning = true
37-
end
38-
39-
task :default => :spec
403

414
# Load custom tasks
425
Dir['tasks/*.rake'].sort.each { |f| load f }

spec/spec_helper.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# encoding: UTF-8
22

3-
require 'rubygems'
3+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
4+
require 'rspec'
45
require 'mysql2'
56
require 'timeout'
67

tasks/jeweler.rake

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
begin
2+
require 'jeweler'
3+
JEWELER = Jeweler::Tasks.new do |gem|
4+
gem.name = "mysql2"
5+
gem.summary = "A simple, fast Mysql library for Ruby, binding to libmysql"
6+
gem.email = "[email protected]"
7+
gem.homepage = "http://github.com/brianmario/mysql2"
8+
gem.authors = ["Brian Lopez"]
9+
gem.require_paths = ["lib", "ext"]
10+
gem.extra_rdoc_files = `git ls-files *.rdoc`.split("\n")
11+
gem.files = `git ls-files`.split("\n")
12+
gem.extensions = ["ext/mysql2/extconf.rb"]
13+
gem.files.include %w(lib/jeweler/templates/.document lib/jeweler/templates/.gitignore)
14+
end
15+
rescue LoadError
16+
puts "jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
17+
end

tasks/rspec.rake

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
begin
2+
require 'rspec'
3+
require 'rspec/core/rake_task'
4+
5+
desc "Run all examples with RCov"
6+
RSpec::Core::RakeTask.new('spec:rcov') do |t|
7+
t.rcov = true
8+
end
9+
RSpec::Core::RakeTask.new('spec') do |t|
10+
t.verbose = true
11+
end
12+
13+
task :default => :spec
14+
rescue LoadError
15+
puts "rspec, or one of its dependencies, is not available. Install it with: sudo gem install rspec"
16+
end

0 commit comments

Comments
 (0)