Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 118 lines (100 sloc) 3.374 kb
e88978d @chneukirchen Add and integrate Rakefile
authored
1 # Rakefile for Rack. -*-ruby-*-
2
3 desc "Run all the tests"
4 task :default => [:test]
5
e5ca5c3 @raggi Further improvements for CI, no more bundle!
raggi authored
6 desc "Install gem dependencies"
7 task :deps do
8 require 'rubygems'
11621ae @BanzaiMan Do not assume 'gem' on $PATH is the same as the one that this Ruby ru…
BanzaiMan authored
9 require 'rbconfig'
e5ca5c3 @raggi Further improvements for CI, no more bundle!
raggi authored
10 spec = Gem::Specification.load('rack.gemspec')
11 spec.dependencies.each do |dep|
12 reqs = dep.requirements_list
13 reqs = (["-v"] * reqs.size).zip(reqs).flatten
14 # Use system over sh, because we want to ignore errors!
11621ae @BanzaiMan Do not assume 'gem' on $PATH is the same as the one that this Ruby ru…
BanzaiMan authored
15 ruby = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"])
16 system ruby, "-S", "gem", "install", '--conservative', dep.name, *reqs
e5ca5c3 @raggi Further improvements for CI, no more bundle!
raggi authored
17 end
18 end
19
806e6e3 @josh Restore old school tar release tools
josh authored
20 desc "Make an archive as .tar.gz"
21 task :dist => [:chmod, :changelog, :rdoc, "SPEC"] do
faafcea @josh whoops, bad restoration
josh authored
22 sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
fc2eb07 @chneukirchen Drop RDOX support
authored
23 sh "pax -waf #{release}.tar -s ':^:#{release}/:' SPEC ChangeLog doc rack.gemspec"
806e6e3 @josh Restore old school tar release tools
josh authored
24 sh "gzip -f -9 #{release}.tar"
25 end
26
27 desc "Make an official release"
28 task :officialrelease do
29 puts "Official build for #{release}..."
30 sh "rm -rf stage"
31 sh "git clone --shared . stage"
32 sh "cd stage && rake officialrelease_really"
33 sh "mv stage/#{release}.tar.gz stage/#{release}.gem ."
34 end
35
fc2eb07 @chneukirchen Drop RDOX support
authored
36 task :officialrelease_really => ["SPEC", :dist, :gem] do
806e6e3 @josh Restore old school tar release tools
josh authored
37 sh "sha1sum #{release}.tar.gz #{release}.gem"
38 end
39
40 def release
dc6b54e @chneukirchen Fix Rakefile
authored
41 "rack-#{File.read("rack.gemspec")[/s.version *= *"(.*?)"/, 1]}"
806e6e3 @josh Restore old school tar release tools
josh authored
42 end
e88978d @chneukirchen Add and integrate Rakefile
authored
43
44 desc "Make binaries executable"
45 task :chmod do
46 Dir["bin/*"].each { |binary| File.chmod(0775, binary) }
e617e8f @chneukirchen Rename spec/ back to test/
authored
47 Dir["test/cgi/test*"].each { |binary| File.chmod(0775, binary) }
e88978d @chneukirchen Add and integrate Rakefile
authored
48 end
49
50 desc "Generate a ChangeLog"
51 task :changelog do
c3d6e4a @chneukirchen Add Rack.release for the version of the release.
authored
52 File.open("ChangeLog", "w") { |out|
53 `git log -z`.split("\0").map { |chunk|
54 author = chunk[/Author: (.*)/, 1].strip
55 date = chunk[/Date: (.*)/, 1].strip
56 desc, detail = $'.strip.split("\n", 2)
57 detail ||= ""
58 detail = detail.gsub(/.*darcs-hash:.*/, '')
59 detail.rstrip!
60 out.puts "#{date} #{author}"
61 out.puts " * #{desc.strip}"
62 out.puts detail unless detail.empty?
63 out.puts
64 }
65 }
e88978d @chneukirchen Add and integrate Rakefile
authored
66 end
67
68
859ab9f @raggi Adding SPEC with rake task dependencies
raggi authored
69 file 'lib/rack/lint.rb'
e88978d @chneukirchen Add and integrate Rakefile
authored
70 desc "Generate Rack Specification"
859ab9f @raggi Adding SPEC with rake task dependencies
raggi authored
71 file "SPEC" => 'lib/rack/lint.rb' do
e88978d @chneukirchen Add and integrate Rakefile
authored
72 File.open("SPEC", "wb") { |file|
73 IO.foreach("lib/rack/lint.rb") { |line|
74 if line =~ /## (.*)/
75 file.puts $1
76 end
77 }
78 }
79 end
80
74d10fc @raggi Make tests easier to run cross-interpreter
raggi authored
81 desc "Run all the fast + platform agnostic tests"
859ab9f @raggi Adding SPEC with rake task dependencies
raggi authored
82 task :test => 'SPEC' do
c0b511e @manveru Ported specs to bacon
manveru authored
83 opts = ENV['TEST'] || '-a'
84 specopts = ENV['TESTOPTS'] ||
74d10fc @raggi Make tests easier to run cross-interpreter
raggi authored
85 "-q -t '^(?!Rack::Adapter|Rack::Session::Memcache|Rack::Server|Rack::Handler)'"
c0b511e @manveru Ported specs to bacon
manveru authored
86
74d10fc @raggi Make tests easier to run cross-interpreter
raggi authored
87 sh "bacon -I./lib:./test #{opts} #{specopts}"
e88978d @chneukirchen Add and integrate Rakefile
authored
88 end
89
ea6cb6f @raggi Move to a CI task, skipping the cgi tests for now, as they're problem…
raggi authored
90 desc "Run all the tests we run on CI"
68aa4e4 @raggi Whoops, that's not what I meant. There is no exclude here.
raggi authored
91 task :ci => :test
ea6cb6f @raggi Move to a CI task, skipping the cgi tests for now, as they're problem…
raggi authored
92
e88978d @chneukirchen Add and integrate Rakefile
authored
93 desc "Run all the tests"
859ab9f @raggi Adding SPEC with rake task dependencies
raggi authored
94 task :fulltest => %w[SPEC chmod] do
c0b511e @manveru Ported specs to bacon
manveru authored
95 opts = ENV['TEST'] || '-a'
1878105 @chneukirchen Silence test suite
authored
96 specopts = ENV['TESTOPTS'] || '-q'
a108671 @raggi 1.9 not having '.' in load path
raggi authored
97 sh "bacon -r./test/gemloader -I./lib:./test -w #{opts} #{specopts}"
e88978d @chneukirchen Add and integrate Rakefile
authored
98 end
99
afb1b4c @josh Modernize packaging and publishing tasks for gemcutter
josh authored
100 task :gem => ["SPEC"] do
101 sh "gem build rack.gemspec"
e88978d @chneukirchen Add and integrate Rakefile
authored
102 end
103
104 desc "Generate RDoc documentation"
6fd9cd9 @chneukirchen gem and rdoc need SPEC
authored
105 task :rdoc => ["SPEC"] do
2978cfd @sferik Add .rdoc extension so GitHub can apply formatting
sferik authored
106 sh(*%w{rdoc --line-numbers --main README.rdoc
35f5aae @chneukirchen Ensure to rebuild rdocs
authored
107 --title 'Rack\ Documentation' --charset utf-8 -U -o doc} +
2978cfd @sferik Add .rdoc extension so GitHub can apply formatting
sferik authored
108 %w{README.rdoc KNOWN-ISSUES SPEC} +
c76306d @chneukirchen Refactor Rakefile
authored
109 Dir["lib/**/*.rb"])
e88978d @chneukirchen Add and integrate Rakefile
authored
110 end
111
112 task :pushsite => [:rdoc] do
c76306d @chneukirchen Refactor Rakefile
authored
113 sh "cd site && git gc"
e926df4 @manveru replace the 'system' calls in Rakefile with 'sh', making them more tr…
manveru authored
114 sh "rsync -avz doc/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
115 sh "rsync -avz site/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/"
c76306d @chneukirchen Refactor Rakefile
authored
116 sh "cd site && git push"
e88978d @chneukirchen Add and integrate Rakefile
authored
117 end
Something went wrong with that request. Please try again.