Skip to content

Commit

Permalink
Documentation and Rakefile updates! Yay!
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Mar 19, 2012
1 parent 6c9103c commit 318b7ac
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,8 +1,10 @@
RDOX
ChangeLog
*.gem
lighttpd.errors
*.rbc
stage
*.tar.gz
Gemfile.lock
.rbx
doc
30 changes: 18 additions & 12 deletions Rakefile
Expand Up @@ -12,13 +12,12 @@ task :deps do
reqs = dep.requirements_list
reqs = (["-v"] * reqs.size).zip(reqs).flatten
# Use system over sh, because we want to ignore errors!
ruby = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"])
system ruby, "-S", "gem", "install", '--conservative', dep.name, *reqs
system Gem.ruby, "-S", "gem", "install", '--conservative', dep.name, *reqs
end
end

desc "Make an archive as .tar.gz"
task :dist => [:chmod, :changelog, :rdoc, "SPEC"] do
task :dist => %w[chmod ChangeLog SPEC rdoc] do
sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
sh "pax -waf #{release}.tar -s ':^:#{release}/:' SPEC ChangeLog doc rack.gemspec"
sh "gzip -f -9 #{release}.tar"
Expand All @@ -33,7 +32,7 @@ task :officialrelease do
sh "mv stage/#{release}.tar.gz stage/#{release}.gem ."
end

task :officialrelease_really => ["SPEC", :dist, :gem] do
task :officialrelease_really => %w[SPEC dist gem] do
sh "sha1sum #{release}.tar.gz #{release}.gem"
end

Expand All @@ -48,7 +47,10 @@ task :chmod do
end

desc "Generate a ChangeLog"
task :changelog do
task :changelog => %w[ChangeLog]

file '.git/index'
file "ChangeLog" => '.git/index' do
File.open("ChangeLog", "w") { |out|
`git log -z`.split("\0").map { |chunk|
author = chunk[/Author: (.*)/, 1].strip
Expand All @@ -65,7 +67,6 @@ task :changelog do
}
end


file 'lib/rack/lint.rb'
desc "Generate Rack Specification"
file "SPEC" => 'lib/rack/lint.rb' do
Expand Down Expand Up @@ -101,17 +102,22 @@ task :gem => ["SPEC"] do
sh "gem build rack.gemspec"
end

task :doc => :rdoc
desc "Generate RDoc documentation"
task :rdoc => ["SPEC"] do
task :rdoc => %w[ChangeLog SPEC] do
sh(*%w{rdoc --line-numbers --main README.rdoc
--title 'Rack\ Documentation' --charset utf-8 -U -o doc} +
%w{README.rdoc KNOWN-ISSUES SPEC} +
Dir["lib/**/*.rb"])
%w{README.rdoc KNOWN-ISSUES SPEC ChangeLog} +
`git ls-files lib/\*\*/\*.rb`.strip.split)
cp "contrib/rdoc.css", "doc/rdoc.css"
end

task :pushdoc => %w[rdoc] do
sh "rsync -avz doc/ rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
end

task :pushsite => [:rdoc] do
task :pushsite => %w[pushdoc] do
sh "cd site && git gc"
sh "rsync -avz doc/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
sh "rsync -avz site/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/"
sh "rsync -avz site/ rack.rubyforge.org:/var/www/gforge-projects/rack/"
sh "cd site && git push"
end

0 comments on commit 318b7ac

Please sign in to comment.