0
+# Rakefile for Rack. -*-ruby-*-
0
+require 'rake/rdoctask'
0
+require 'rake/testtask'
0
+desc "Run all the tests"
0
+task :default => [:test]
0
+desc "Do predistribution stuff"
0
+task :predist => [:chmod, :changelog, :rdoc]
0
+desc "Make an archive as .tar.gz"
0
+task :dist => :fulltest do
0
+ sh "export DARCS_REPO=#{File.expand_path "."}; " +
0
+ "darcs dist -d rack-#{get_darcs_tree_version}"
0
+# Helper to retrieve the "revision number" of the darcs tree.
0
+def get_darcs_tree_version
0
+ unless File.directory? "_darcs"
0
+ changes = `darcs changes`
0
+ changes.each("\n\n") { |change|
0
+ head, title, desc = change.split("\n", 3)
0
+ elsif title =~ /tagged (.*)/
0
+ # Tag. We look for these.
0
+ warn "Unparsable change: #{change}"
0
+ tag + "." + count.to_s
0
+ `darcs query manifest`.split("\n").map { |f| f.gsub(/\A\.\//, '') }
0
+desc "Make binaries executable"
0
+ Dir["bin/*"].each { |binary| File.chmod(0775, binary) }
0
+ Dir["test/cgi/test*"].each { |binary| File.chmod(0775, binary) }
0
+desc "Generate a ChangeLog"
0
+ sh "darcs changes --repo=#{ENV["DARCS_REPO"] || "."} >ChangeLog"
0
+ sh "specrb -Ilib:test -a --rdox >RDOX"
0
+desc "Generate Rack Specification"
0
+ File.open("SPEC", "wb") { |file|
0
+ IO.foreach("lib/rack/lint.rb") { |line|
0
+desc "Run all the fast tests"
0
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS'] || '-t "^(?!Rack::Handler|Rack::Adapter)"'}"
0
+desc "Run all the tests"
0
+ sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS']}"
0
+ $" << "sources" if defined? FromSrc
0
+ require 'rake/packagetask'
0
+ require 'rake/gempackagetask'
0
+ spec = Gem::Specification.new do |s|
0
+ s.version = get_darcs_tree_version
0
+ s.platform = Gem::Platform::RUBY
0
+ s.summary = "a modular Ruby webserver interface"
0
+ s.description = <<-EOF
0
+Rack provides minimal, modular and adaptable interface for developing
0
+web applications in Ruby. By wrapping HTTP requests and responses in
0
+the simplest way possible, it unifies and distills the API for web
0
+servers, web frameworks, and software in between (the so-called
0
+middleware) into a single method call.
0
+Also see http://rack.rubyforge.org.
0
+ s.files = manifest + %w(SPEC RDOX)
0
+ s.executables << 'rackup'
0
+ s.require_path = 'lib'
0
+ s.extra_rdoc_files = ['README', 'SPEC', 'RDOX', 'KNOWN-ISSUES']
0
+ s.test_files = Dir['test/{test,spec}_*.rb']
0
+ s.author = 'Christian Neukirchen'
0
+ s.email = 'chneukirchen@gmail.com'
0
+ s.homepage = 'http://rack.rubyforge.org'
0
+ s.rubyforge_project = 'rack'
0
+ Rake::GemPackageTask.new(spec) do |p|
0
+desc "Generate RDoc documentation"
0
+Rake::RDocTask.new(:rdoc) do |rdoc|
0
+ rdoc.options << '--line-numbers' << '--inline-source' <<
0
+ '--main' << 'README' <<
0
+ '--title' << 'Rack Documentation' <<
0
+ '--charset' << 'utf-8'
0
+ rdoc.rdoc_files.include 'README'
0
+ rdoc.rdoc_files.include 'KNOWN-ISSUES'
0
+ rdoc.rdoc_files.include 'SPEC'
0
+ rdoc.rdoc_files.include 'RDOX'
0
+ rdoc.rdoc_files.include('lib/rack.rb')
0
+ rdoc.rdoc_files.include('lib/rack/*.rb')
0
+ rdoc.rdoc_files.include('lib/rack/*/*.rb')
0
+task :rdoc => ["SPEC", "RDOX"]
0
+task :pushsite => [:rdoc] do
0
+ sh "rsync -avz doc/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
0
+ sh "rsync -avz site/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/"
0
+ require 'rcov/rcovtask'
0
+ Rcov::RcovTask.new do |t|
0
+ t.test_files = FileList['test/{spec,test}_*.rb']
0
+ t.verbose = true # uncomment to see the executed command
0
+ t.rcov_opts = ["--text-report",
0
+ "--include-file", "^lib,^test",
0
+ "--exclude-only", "^/usr,^/home/.*/src,active_"]
Comments
No one has commented yet.