2010-01-22 03:09:18 +00:00
|
|
|
require 'rake/testtask'
|
|
|
|
|
2010-07-24 01:28:33 +00:00
|
|
|
task :default => :test
|
2010-02-10 06:48:08 +00:00
|
|
|
|
2010-07-24 01:28:33 +00:00
|
|
|
def gemspec
|
|
|
|
@gemspec ||= begin
|
|
|
|
file = File.expand_path('../vagrant.gemspec', __FILE__)
|
|
|
|
eval(File.read(file), binding, file)
|
2010-01-31 06:06:22 +00:00
|
|
|
end
|
2010-07-24 01:28:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'rake/gempackagetask'
|
2010-01-31 06:06:22 +00:00
|
|
|
rescue LoadError
|
2010-07-24 01:28:33 +00:00
|
|
|
task(:gem) { $stderr.puts '`gem install rake` to package gems' }
|
|
|
|
else
|
|
|
|
Rake::GemPackageTask.new(gemspec) do |pkg|
|
|
|
|
pkg.gem_spec = gemspec
|
|
|
|
end
|
|
|
|
task :gem => :gemspec
|
2010-01-31 06:06:22 +00:00
|
|
|
end
|
|
|
|
|
2010-07-24 01:28:33 +00:00
|
|
|
desc "install the gem locally"
|
|
|
|
task :install => :package do
|
2010-07-28 02:19:32 +00:00
|
|
|
sh %{gem install pkg/#{gemspec.name}-#{gemspec.version} --no-ri --no-rdoc}
|
2010-07-24 01:28:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "validate the gemspec"
|
|
|
|
task :gemspec do
|
|
|
|
gemspec.validate
|
|
|
|
end
|
2010-01-22 03:09:18 +00:00
|
|
|
|
|
|
|
Rake::TestTask.new do |t|
|
|
|
|
t.libs << "test"
|
2010-01-22 05:08:55 +00:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
2010-01-22 05:07:01 +00:00
|
|
|
end
|
2010-03-04 07:14:06 +00:00
|
|
|
|
|
|
|
begin
|
|
|
|
require 'yard'
|
|
|
|
YARD::Rake::YardocTask.new do |t|
|
|
|
|
t.options = ['--main', 'README.md', '--markup', 'markdown']
|
|
|
|
t.options += ['--title', 'Vagrant Developer Documentation']
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Yard not available. Install it with: gem install yard"
|
|
|
|
puts "if you wish to be able to generate developer documentation."
|
2010-03-09 16:25:16 +00:00
|
|
|
end
|