Permalink
Browse files

Modernize packaging and publishing tasks for gemcutter

  • Loading branch information...
1 parent 4870337 commit afb1b4c0aeee1e2f443b5783b42b69e1716bfcac @josh josh committed Dec 25, 2009
Showing with 41 additions and 87 deletions.
  1. +3 −87 Rakefile
  2. +38 −0 rack.gemspec
View
90 Rakefile
@@ -7,42 +7,6 @@ desc "Run all the tests"
task :default => [:test]
-desc "Make an archive as .tar.gz"
-task :dist => [:chmod, :changelog, :rdoc, "SPEC", "rack.gemspec"] do
- FileUtils.touch("RDOX")
- sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
- sh "pax -waf #{release}.tar -s ':^:#{release}/:' RDOX SPEC ChangeLog doc rack.gemspec"
- sh "gzip -f -9 #{release}.tar"
-end
-
-desc "Make an official release"
-task :officialrelease do
- puts "Official build for #{release}..."
- sh "rm -rf stage"
- sh "git clone --shared . stage"
- sh "cd stage && rake officialrelease_really"
- sh "mv stage/#{release}.tar.gz stage/#{release}.gem ."
-end
-
-task :officialrelease_really => [:fulltest, "RDOX", "SPEC", :dist, :gem] do
- sh "sha1sum #{release}.tar.gz #{release}.gem"
-end
-
-
-def version
- abort "You need to pass VERSION=... to build packages." unless ENV["VERSION"]
- ENV["VERSION"]
-end
-
-def release
- "rack-#{version}"
-end
-
-def manifest
- `git ls-files`.split("\n")
-end
-
-
desc "Make binaries executable"
task :chmod do
Dir["bin/*"].each { |binary| File.chmod(0775, binary) }
@@ -94,57 +58,9 @@ task :fulltest => [:chmod] do
sh "specrb -Ilib:test -w #{ENV['TEST'] || '-a'} #{ENV['TESTOPTS']}"
end
-begin
- require 'rubygems'
-rescue LoadError
- # Too bad.
-else
- task "rack.gemspec" do
- spec = Gem::Specification.new do |s|
- s.name = "rack"
- s.version = version
- s.platform = Gem::Platform::RUBY
- s.summary = "a modular Ruby webserver interface"
-
- s.description = <<-EOF
-Rack provides minimal, modular and adaptable interface for developing
-web applications in Ruby. By wrapping HTTP requests and responses in
-the simplest way possible, it unifies and distills the API for web
-servers, web frameworks, and software in between (the so-called
-middleware) into a single method call.
-
-Also see http://rack.rubyforge.org.
- EOF
-
- s.files = manifest + %w(SPEC RDOX rack.gemspec)
- s.bindir = 'bin'
- s.executables << 'rackup'
- s.require_path = 'lib'
- s.has_rdoc = true
- s.extra_rdoc_files = ['README', 'SPEC', 'RDOX', 'KNOWN-ISSUES']
- s.test_files = Dir['test/{test,spec}_*.rb']
-
- s.author = 'Christian Neukirchen'
- s.email = 'chneukirchen@gmail.com'
- s.homepage = 'http://rack.rubyforge.org'
- s.rubyforge_project = 'rack'
-
- s.add_development_dependency 'test-spec'
-
- s.add_development_dependency 'camping'
- s.add_development_dependency 'fcgi'
- s.add_development_dependency 'memcache-client'
- s.add_development_dependency 'mongrel'
- s.add_development_dependency 'thin'
- end
-
- File.open("rack.gemspec", "w") { |f| f << spec.to_ruby }
- end
-
- task :gem => ["rack.gemspec", "SPEC"] do
- FileUtils.touch("RDOX")
- sh "gem build rack.gemspec"
- end
+task :gem => ["SPEC"] do
+ FileUtils.touch("RDOX")
+ sh "gem build rack.gemspec"
end
desc "Generate RDoc documentation"
View
38 rack.gemspec
@@ -0,0 +1,38 @@
+Gem::Specification.new do |s|
+ s.name = "rack"
+ s.version = "1.1.0"
+ s.platform = Gem::Platform::RUBY
+ s.summary = "a modular Ruby webserver interface"
+
+ s.description = <<-EOF
+Rack provides minimal, modular and adaptable interface for developing
+web applications in Ruby. By wrapping HTTP requests and responses in
+the simplest way possible, it unifies and distills the API for web
+servers, web frameworks, and software in between (the so-called
+middleware) into a single method call.
+
+Also see http://rack.rubyforge.org.
+EOF
+
+ s.files = Dir['{bin/*,contrib/*,example/*,lib/**/*}'] +
+ %w(COPYING KNOWN-ISSUES rack.gemspec RDOX README SPEC)
+ s.bindir = 'bin'
+ s.executables << 'rackup'
+ s.require_path = 'lib'
+ s.has_rdoc = true
+ s.extra_rdoc_files = ['README', 'SPEC', 'KNOWN-ISSUES']
+ s.test_files = Dir['test/{test,spec}_*.rb']
+
+ s.author = 'Christian Neukirchen'
+ s.email = 'chneukirchen@gmail.com'
+ s.homepage = 'http://rack.rubyforge.org'
+ s.rubyforge_project = 'rack'
+
+ s.add_development_dependency 'test-spec'
+
+ s.add_development_dependency 'camping'
+ s.add_development_dependency 'fcgi'
+ s.add_development_dependency 'memcache-client'
+ s.add_development_dependency 'mongrel'
+ s.add_development_dependency 'thin'
+end

0 comments on commit afb1b4c

Please sign in to comment.