# Rakefile for flexmock -*- ruby -*- require 'rubygems' require 'rake/gempackagetask' require 'rake/clean' require 'rake/rdoctask' require 'rake/testtask' CLOBBER.include("html", 'pkg') PKG_VERSION = '0.1.4' PKG_FILES = FileList[ '[A-Z]*', 'lib/**/*.rb', 'test/**/*.rb', '*.blurb', 'install.rb' ] RDOC_FILES = FileList[ 'README', 'CHANGELOG', 'lib/**/*.rb', 'doc/**/*.rdoc', 'test/*.rb' ] task :default => [:test] # Test Targets ------------------------------------------------------- Rake::TestTask.new do |t| t.pattern = 'test/test*.rb' t.verbose = true end # RDoc Target -------------------------------------------------------- rd = Rake::RDocTask.new("rdoc") do |rdoc| rdoc.rdoc_dir = 'html' rdoc.template = 'doc/jamis.rb' # rdoc.template = 'html' # rdoc.template = 'kilmer' # rdoc.template = 'css2' rdoc.title = "Flex Mock" rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README' rdoc.rdoc_files.include('[A-Z][A-Z]*') rdoc.rdoc_files.include('lib/**/*.rb') end task :rdoc => ["README"] file "README" => ["Rakefile"] do ruby %{-i.bak -pe 'sub!(/^Version *:: *(\\d+\\.)+\\d+ *$/, "Version :: #{PKG_VERSION}")' README} end # Package Task ------------------------------------------------------- if ! defined?(Gem) puts "Package Target requires RubyGEMs" else spec = Gem::Specification.new do |s| #### Basic information. s.name = 'flexmock' s.version = PKG_VERSION s.summary = "Simple and Flexible Mock Objects for Testing" s.description = %{ FlexMock is a extremely simple mock object class compatible with the Test::Unit framework. Although the FlexMock's interface is simple, it is very flexible. } # ' #### Dependencies and requirements. #s.add_dependency('log4r', '> 1.0.4') #s.requirements << "" #### Which files are to be included in this gem? Everything! (Except CVS directories.) s.files = PKG_FILES.to_a #### C code extensions. #s.extensions << "ext/rmagic/extconf.rb" #### Load-time details: library and application (you will need one or both). s.require_path = 'lib' # Use these for libraries. #### Documentation and testing. s.has_rdoc = true s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a s.rdoc_options << '--title' << 'Flex Mock' << '--main' << 'README' << '--line-numbers' #### Author and project details. s.author = "Jim Weirich" s.email = "jim@weirichhouse.org" s.homepage = "http://onestepback.org/software/flexmock" end Rake::GemPackageTask.new(spec) do |pkg| pkg.need_zip = true pkg.need_tar = true end end require 'rake/contrib/publisher' require 'rake/contrib/sshpublisher' task :publish => [:rdoc] do html_publisher = Rake::SshFreshDirPublisher.new( 'umlcoop', 'htdocs/software/flexmock', 'html') blurb_publisher = Rake::SshFilePublisher.new( 'umlcoop', 'htdocs/software/flexmock', '.', 'flexmock.blurb') html_publisher.upload blurb_publisher.upload end