require 'rake' begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "restfulx" gem.summary = "RestfulX Framework Code Generation Engine / Rails 2.1+ Integration Support" gem.email = "dima.berastau@gmail.com" gem.homepage = "http://restfulx.org" gem.rubyforge_project = "restfulx" gem.authors = ["Dima Berastau"] gem.files = FileList["[A-Z]*", "{bin,app_generators,rails_generators,rxgen_generators,lib,test,spec,tasks}/**/*"] gem.add_dependency('rubigen', '>= 1.5.0') gem.add_dependency('activesupport', '>=2.0.0') end rescue LoadError puts "Jeweler not available. Install it with: sudo gem install dima-jeweler -s http://gems.github.com" end require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| config = YAML.load(File.read('VERSION.yml')) rdoc.rdoc_dir = 'doc/api' rdoc.title = "RestfulX #{config[:major]}.#{config[:minor]}.#{config[:patch]}" rdoc.options << '--line-numbers' << '--inline-source' #<< '-Tjamis' rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end begin require 'rake/contrib/sshpublisher' namespace :rubyforge do namespace :release do desc "Publish RDoc to RubyForge." task :docs => [:rdoc] do config = YAML.load( File.read(File.expand_path('~/.rubyforge/user-config.yml')) ) host = "#{config['username']}@rubyforge.org" remote_dir = "/var/www/gforge-projects/restfulx/" local_dir = 'doc/api' Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload end end end rescue LoadError puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured." end require 'rake/testtask' Rake::TestTask.new(:test) do |t| t.libs << 'lib' << 'test' t.pattern = 'test/**/test_*.rb' t.verbose = false end begin require 'rcov/rcovtask' Rcov::RcovTask.new do |t| t.libs << 'test' t.test_files = FileList['test/**/test_*.rb'] t.verbose = true end rescue LoadError puts "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" end begin require 'cucumber/rake/task' Cucumber::Rake::Task.new(:features) rescue LoadError puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" end task :default => :test