summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2014-04-26 17:02:27 -0400
committerAustin Ziegler <austin@zieglers.ca>2014-04-26 17:02:27 -0400
commit5a81927584dc5a715f17ed4d72b96bfac9a0f5e0 (patch)
tree9e5ef5891718ed72988468bcf3c7c2c8a69b998a /Rakefile
parentc2479b3095a01620843d7986b5ed97903d47bae6 (diff)
downloaddiff-lcs-5a81927584dc5a715f17ed4d72b96bfac9a0f5e0.tar.gz
Enabling code coverage.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile32
1 files changed, 26 insertions, 6 deletions
diff --git a/Rakefile b/Rakefile
index 5186800..7ca5aa3 100644
--- a/Rakefile
+++ b/Rakefile
@@ -6,17 +6,15 @@ require 'hoe'
Hoe.plugin :bundler
Hoe.plugin :doofus
-Hoe.plugin :email
+Hoe.plugin :email unless ENV['CI'] or ENV['TRAVIS']
Hoe.plugin :gemspec2
Hoe.plugin :git
-Hoe.plugin :rubyforge
Hoe.plugin :travis
-Hoe.spec 'diff-lcs' do
- developer('Austin Ziegler', 'austin@rubyforge.org')
+spec = Hoe.spec 'diff-lcs' do
+ developer('Austin Ziegler', 'halostatue@gmail.com')
- self.remote_rdoc_dir = '.'
- self.rsync_args << ' --exclude=statsvn/'
+ self.need_tar = true
self.history_file = 'History.rdoc'
self.readme_file = 'README.rdoc'
@@ -32,10 +30,32 @@ Hoe.spec 'diff-lcs' do
self.extra_dev_deps << ['hoe-travis', '~> 1.2']
self.extra_dev_deps << ['rake', '~> 10.0']
self.extra_dev_deps << ['rspec', '~> 2.0']
+
+ if RUBY_VERSION >= '1.9' and (ENV['CI'] or ENV['TRAVIS'])
+ self.extra_dev_deps << ['simplecov', '~> 0.8']
+ self.extra_dev_deps << ['coveralls', '~> 0.7']
+ end
end
unless Rake::Task.task_defined? :test
task :test => :spec
end
+if RUBY_VERSION >= '1.9'
+ namespace :spec do
+ desc "Submit test coverage to Coveralls"
+ task :coveralls do
+ ENV['COVERAGE'] = ENV['COVERALLS'] = 'yes'
+ end
+
+ desc "Runs test coverage. Only works Ruby 1.9+ and assumes 'simplecov' is installed."
+ task :coverage do
+ ENV['COVERAGE'] = 'yes'
+ Rake::Task['spec'].execute
+ end
+ end
+
+ Rake::Task['travis'].prerequisites.replace(%w(test:coveralls))
+end
+
# vim: syntax=ruby