# Gravaty # Copyright © 2013 Marco Bresciani # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with this program. If not, see # <www.gnu.org/licenses/>.
# ———————————————————————————————————————- # ———————————————————————————————- Required libraries/gems # ———————————————————————————————————————- require 'cucumber/rake/task' require 'rake' require 'rake/clean' require 'rake/testtask' require 'rdoc/task' require 'rubygems' require 'rubygems/package_task'
gravaty = Gem::Specification.load('gravaty.gemspec')
# ———————————————————————————— Build the gem (Task Rake Package) desc 'Build the gem (Task Rake Package)' Rake::PackageTask.new gravaty do |package|
package.name = gravaty.name.gsub(' ', '_') package.need_tar = false package.need_tar_bz2 = false package.need_tar_gz = false package.need_zip = true package.package_files = gravaty.files package.version = gravaty.version
end
# ——————————————————————– Build the RDoc gem documentation (task Rake RDoc) desc 'Build the RDoc gem documentation (task Rake RDoc)' Rake::RDocTask.new do |rdoc|
rdoc.main = 'README' rdoc.options << '--line-numbers' rdoc.rdoc_files.add gravaty.files rdoc.rdoc_dir = 'doc/rdoc' rdoc.title = gravaty.name + ' ' + gravaty.version.to_s
end
# —————————————————————————— Run the gem unit tests (task Rake Test) desc 'Run the gem unit tests (task Rake Test)' Rake::TestTask.new do |test_task|
test_task.pattern = FileList['test /test_*.rb'] test_task.test_files = FileList['test/ *.rb'] test_task.verbose = true test_task.warning = true
end
# ———————————————————————- Run the gem Cucumber tests (task Cucumber Rake) desc 'Run the gem Cucumber tests (task Cucumber Rake)' Cucumber::Rake::Task.new do |cuke_task|
cuke_task.cucumber_opts = 'features --format pretty'
end