Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ef60ed6f38
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (46 sloc) 1.553 kb
# -*- ruby -*-
require 'rubygems'
require 'spec'
require 'spec/rake/spectask'
require './lib/datamapper4rails/version.rb'
build_dir = 'target'
desc 'clean up'
task :clean do
FileUtils.rm_rf(build_dir)
end
desc 'Package as a gem.'
task :package do
require 'fileutils'
gemspec = Dir['*.gemspec'].first
Kernel.system("#{RUBY} -S gem build #{gemspec}")
FileUtils.mkdir_p(build_dir)
gem = Dir['*.gem'].first
FileUtils.mv(gem, File.join(build_dir,"#{gem}"))
puts File.join(build_dir,"#{gem}")
end
desc 'Install the package as a gem.'
task :install => [:package] do
gem = Dir[File.join(build_dir, '*.gem')].first
extra = ENV['GEM_HOME'].nil? && ENV['GEM_PATH'].nil? ? "--user-install" : ""
Kernel.system("#{RUBY} -S gem install --local #{gem} --no-ri --no-rdoc #{extra}")
end
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
if File.exists?(File.join('spec','spec.opts'))
t.spec_opts << '--options' << File.join('spec','spec.opts')
end
t.spec_files = Dir.glob(File.join('spec','**','*_spec.rb'))
end
desc 'generate rails using all generators and run the specs'
task :integration_tests => [:spec, :install] do
require 'datamapper4rails/integration_test'
Datamapper4Rails::IntegrationTest.new do |t|
t.generate "datamapper_model role name:string"
t.generate "datamapper_scaffold domain name:string"
t.generate "datamapper_rspec_model user name:string"
t.generate "datamapper_rspec_scaffold group name:string"
end
end
#require 'yard'
#YARD::Rake::YardocTask.new
# vim: syntax=Ruby
Jump to Line
Something went wrong with that request. Please try again.