1 require 'rake/gempackagetask'
3 task :clean => :clobber_package
5 spec = Gem::Specification.new do |s|
7 s.version = Thin::VERSION::STRING
8 s.platform = WIN ? Gem::Platform::CURRENT : Gem::Platform::RUBY
10 s.description = "A thin and fast web server"
11 s.author = "Marc-Andre Cournoyer"
12 s.email = 'macournoyer@gmail.com'
13 s.homepage = 'http://code.macournoyer.com/thin/'
14 s.executables = %w(thin)
16 s.required_ruby_version = '>= 1.8.6' # Makes sure the CGI eof fix is there
18 s.add_dependency 'rack', '>= 0.2.0'
19 s.add_dependency 'eventmachine', '>= 0.8.1'
21 s.add_dependency 'daemons', '>= 1.0.9'
24 s.files = %w(COPYING CHANGELOG README Rakefile) +
25 Dir.glob("{benchmark,bin,doc,example,lib,spec,tasks}/**/*") +
26 Dir.glob("ext/**/*.{h,c,rb,rl}")
29 s.files += ["lib/thin_parser.#{Config::CONFIG['DLEXT']}"]
31 s.extensions = FileList["ext/**/extconf.rb"].to_a
34 s.require_path = "lib"
38 Rake::GemPackageTask.new(spec) do |p|
44 puts "Don't forget to tag the release:"
45 puts " git tag -a v#{Thin::VERSION::STRING}"
48 task :gem => :tag_warn
51 desc 'Upload gem to code.macournoyer.com'
52 task :upload => :gem do
53 upload "pkg/#{spec.full_name}.gem", 'gems'
54 system 'ssh macournoyer@macournoyer.com "cd code.macournoyer.com && gem generate_index"'
57 desc 'Upload gem to rubyforge.org'
58 task :upload_rubyforge => :gem do
60 sh "rubyforge add_release thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}.gem"
61 sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}.gem"
65 task :install => [:clobber, :compile, :package] do
66 sh "#{SUDO} #{gem} install pkg/#{spec.full_name}.gem"
69 task :uninstall => :clean do
70 sh "#{SUDO} #{gem} uninstall -v #{Thin::VERSION::STRING} -x #{Thin::NAME}"
75 RUBY_1_9 ? 'gem19' : 'gem'