rakefile.rb in datamapper-0.1.1 vs rakefile.rb in datamapper-0.2.0

- old
+ new

@@ -4,77 +4,99 @@ require 'spec/rake/spectask' require 'rake/rdoctask' require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' -task :default => 'test' +Dir[File.dirname(__FILE__) + '/tasks/*'].each { |t| require(t) } -desc "Run specifications" -Spec::Rake::SpecTask.new('test') do |t| - t.spec_opts = [ '-rspec/spec_helper' ] - t.spec_files = FileList['spec/*.rb', (ENV['FILES'] || 'spec/**/*_spec.rb')] -end +task :default => 'dm:spec' -desc "Run comparison with ActiveRecord" -task :perf do - load 'performance.rb' -end +namespace :dm do -desc "Profile DataMapper" -task :profile do - load 'profile_data_mapper.rb' + desc "Setup Environment" + task :environment do + require 'environment' + end + + desc "Run specifications" + Spec::Rake::SpecTask.new('spec') do |t| + t.spec_opts = [ '-rspec/spec_helper' ] + t.spec_files = FileList[(ENV['FILES'] || 'spec/**/*_spec.rb')] + end + + desc "Run comparison with ActiveRecord" + task :perf do + load 'performance.rb' + end + + desc "Profile DataMapper" + task :profile do + load 'profile_data_mapper.rb' + end + end -PACKAGE_VERSION = '0.1.1' +PACKAGE_VERSION = '0.2.0' PACKAGE_FILES = FileList[ 'README', 'CHANGELOG', 'MIT-LICENSE', '*.rb', 'lib/**/*.rb', - 'spec/**/*.{rb,yaml}' + 'spec/**/*.{rb,yaml}', + 'tasks/**/*', + 'plugins/**/*' ].to_a PROJECT = 'datamapper' +task :ls do + p PACKAGE_FILES.reject { |path| path =~ /(^spec|\/spec|\/swig\_)/ }.sort +end + desc "Generate Documentation" rd = Rake::RDocTask.new do |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "DataMapper -- An Object/Relational Mapper for Ruby" rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README' - rdoc.rdoc_files.include(PACKAGE_FILES.reject { |path| path =~ /^(spec|\w+\.rb)/ }) + rdoc.rdoc_files.include(PACKAGE_FILES.reject { |path| path =~ /(^spec|\/spec|\/swig\_)/ }) end -gem_spec = Gem::Specification.new do |s| +gem_spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = PROJECT s.summary = "An Object/Relational Mapper for Ruby" - s.description = "It's ActiveRecord, but Faster, Better, Simpler." + s.description = "Faster, Better, Simpler." s.version = PACKAGE_VERSION - + s.authors = 'Sam Smoot' s.email = 'ssmoot@gmail.com' s.rubyforge_project = PROJECT s.homepage = 'http://datamapper.org' - + s.files = PACKAGE_FILES - + s.require_path = 'lib' s.requirements << 'none' s.autorequire = 'data_mapper' + s.add_dependency('fastthread') s.has_rdoc = true s.rdoc_options << '--line-numbers' << '--inline-source' << '--main' << 'README' - s.extra_rdoc_files = rd.rdoc_files.reject { |path| path =~ /\.rb$/ }.to_a + s.extra_rdoc_files = PACKAGE_FILES.reject { |path| path =~ /(^spec|\/spec|\/swig\_)/ }.to_a end Rake::GemPackageTask.new(gem_spec) do |p| p.gem_spec = gem_spec p.need_tar = true p.need_zip = true end desc "Publish to RubyForge" task :rubyforge => [ :rdoc, :gem ] do - Rake::SshDirPublisher.new(ENV['RUBYFORGE_USER'], "/var/www/gforge-projects/#{PROJECT}", 'doc').upload + Rake::SshDirPublisher.new("#{ENV['RUBYFORGE_USER']}@rubyforge.org", "/var/www/gforge-projects/#{PROJECT}", 'doc').upload +end + +task :install => :package do + sh %{sudo gem install pkg/#{PROJECT}-#{PACKAGE_VERSION}} end \ No newline at end of file