#-- # $Id: Rakefile 2 2006-08-25 00:11:17Z prelude $ # # This file is part of the Prelude library that provides tools to # enable Haskell style functional programming in Ruby. # # http://prelude.rubyforge.org # # Copyright (C) 2006 APP Design, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #++ require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' require 'fileutils' require File.join(File.dirname(__FILE__), 'lib', 'prelude') PKG_NAME = 'prelude' PKG_VERSION = Prelude::VERSION PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" PKG_DESTINATION = "../#{PKG_NAME}" RELEASE_NAME = "REL #{PKG_VERSION}" RUBY_FORGE_PROJECT = "prelude" RUBY_FORGE_USER = "prelude" desc "Default Task" task :default => [ :test ] # Run the unit tests Rake::TestTask.new { |t| t.libs << "test" t.test_files = Dir['test/ts_*.rb'] t.verbose = true } # Generate the RDoc documentation Rake::RDocTask.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Prelude -- a Haskell-like library for functional programming" rdoc.options << '--line-numbers' << '--inline-source' rdoc.template = "#{ENV['template']}.rb" if ENV['template'] rdoc.rdoc_files.include('README') rdoc.rdoc_files.include('CHANGELOG') rdoc.rdoc_files.include('TODO') rdoc.rdoc_files.include('lib/**/*.rb') } # Create compressed packages by running 'rake gem' desc "gem task" task :gem => [ :clobber, :rdoc ] # # Here's how to look inside the gem package: # ~..>tar xvf prelude-0.0.1.gem; gunzip data.tar.gz metadata.gz; tar xvf data.tar; cat metadata spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = PKG_NAME s.summary = "Haskell-like functional library" s.description = %q{Enables Ruby programmers to use higher functions, monads, and other Haskell features.} s.version = PKG_VERSION s.author = "Ivan K. and APP Design, Inc." s.email = "prelude@rubyforge.org" s.rubyforge_project = "prelude" s.homepage = "http://prelude.rubyforge.org" s.has_rdoc = true s.requirements << 'none' s.require_path = 'lib' s.autorequire = 'prelude' s.files = [ "Rakefile", "README", "TODO", "CHANGELOG", "COPYING" ] s.files = s.files + Dir.glob( "doc/**/*" ).delete_if { |item| item.include?( "\.svn" ) } s.files = s.files + Dir.glob( "examples/**/*" ).delete_if { |item| item.include?( "\.svn" ) } s.files = s.files + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) } s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "\.svn" ) } s.test_files = Dir.glob( "test/**/ts_*rb" ).delete_if { |item| item.include?( "\.svn" ) } end Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec p.need_tar = true p.need_zip = true end