forked from bploetz/versionist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
44 lines (37 loc) · 1.18 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'rspec/core/rake_task'
require 'rdoc/task'
require 'versionist/version'
GEMFILE_MAP = {"gemfiles/Rails-3.0" => "Rails 3.0", "gemfiles/Rails-3.1" => "Rails 3.1", "gemfiles/Rails-3.2" => "Rails 3.2"}
# To run the tests locally:
# gem install bundler
# rake test:all
namespace :test do
desc "Installs all dependencies"
task :setup do
GEMFILE_MAP.each do |gemfile, name|
puts "Installing gems for testing with #{name} ..."
sh "env BUNDLE_GEMFILE=#{File.dirname(__FILE__) + '/' + gemfile} bundle install"
end
end
GEMFILE_MAP.each do |gemfile, name|
desc "Run all tests against #{name}"
task gemfile.downcase.gsub(/\./, "_") do
sh "env BUNDLE_GEMFILE=#{gemfile} bundle exec rake"
end
end
task :all=> [:setup] + GEMFILE_MAP.map {|gemfile, name| "test:#{gemfile.downcase.gsub(/\./, "_")}"}
end
task :build do
system "gem build versionist.gemspec"
end
desc "Run all specs"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "spec/**/*_spec.rb"
end
task :default => [:spec]
RDoc::Task.new do |rdoc|
files = ['lib/**/*.rb']
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "Versionist #{Versionist::VERSION}"
rdoc.rdoc_files.include('lib/**/*.rb')
end