require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' PKG_VERSION = "1.0.0" PKG_FILES = FileList[ "lib/**/*", "bin/*", "test/**/*", "[A-Z]*", "Rakefile" ] desc "Default Task" task :default => [ :test ] # Run the unit tests desc "Run all unit tests" Rake::TestTask.new("test") { |t| t.libs << "lib" t.pattern = 'test/*/*_test.rb' t.verbose = true } # Genereate the RDoc documentation desc "Create documentation" Rake::RDocTask.new("doc") { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Classifier library" rdoc.options << '--line-numbers --inline-source --accessor' rdoc.rdoc_files.include('README') rdoc.rdoc_files.include('lib/**/*.rb') } # Genereate the package spec = Gem::Specification.new do |s| #### Basic information. s.name = 'classifier' s.version = "1.0" s.summary = <<-EOF A general classifier module to allow Bayesian and other types of classifications. EOF s.description = <<-EOF A general classifier module to allow Bayesian and other types of classifications. EOF #### Which files are to be included in this gem? Everything! (Except CVS directories.) s.files = PKG_FILES #### Load-time details: library and application (you will need one or both). s.require_path = 'lib' s.autorequire = 'classifier' #### Documentation and testing. s.has_rdoc = true #### Author and project details. s.author = "Lucas Carlson" s.email = "lucas@rufy.com" s.homepage = "http://rubyforge.org/projects/classifier/" end Rake::GemPackageTask.new(spec) do |pkg| pkg.need_zip = false pkg.need_tar = true end desc "Publish to RubyForge" task :rubyforge do Rake::RubyForgePublisher.new('classifier', 'cardmagic').upload end