Permalink
Browse files

tidying up rakefile, now spec is the default action

  • Loading branch information...
1 parent 0f29b54 commit b91361418be923fba502d96d854b70f2434e55a5 @diogob committed May 22, 2012
Showing with 16 additions and 6 deletions.
  1. +16 −6 Rakefile
View
@@ -2,16 +2,29 @@
require 'rubygems'
require 'bundler'
+require 'rake'
+require 'jeweler'
+require 'rspec/core/rake_task'
+require 'rdoc/task'
+
+task :default => :spec
+
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 'jeweler'
+RSpec::Core::RakeTask.new(:spec)
+
+RSpec::Core::RakeTask.new(:coverage) do |t|
+ t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec']
+end
+
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "activerecord-postgres-hstore"
@@ -25,14 +38,11 @@ Jeweler::Tasks.new do |gem|
end
Jeweler::RubygemsDotOrgTasks.new
-task :default => :test
-
-require 'rdoc/task'
RDoc::Task.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "activerecord-postgres-hstore #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
+

0 comments on commit b913614

Please sign in to comment.