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