public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
macournoyer (author)
Thu Feb 07 08:06:01 -0800 2008
commit  580bf4cf1184d3c12dbdaade8d1e0375e328f879
tree    b12d52d05ac4c859f24eea4586730cda2a096f19
parent  74c348b278bbfa423c1728942ff6ce2529276190
thin / tasks / gem.rake
100644 98 lines (81 sloc) 3.083 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
require 'rake/gempackagetask'
 
task :clean => :clobber_package
 
spec = Gem::Specification.new do |s|
  s.name = Thin::NAME
  s.version = Thin::VERSION::STRING
  s.platform = WIN ? Gem::Platform::CURRENT : Gem::Platform::RUBY
  s.summary =
  s.description = "A thin and fast web server"
  s.author = "Marc-Andre Cournoyer"
  s.email = 'macournoyer@gmail.com'
  s.homepage = 'http://code.macournoyer.com/thin/'
  s.executables = %w(thin)
 
  s.required_ruby_version = '>= 1.8.6' # Makes sure the CGI eof fix is there
  
  s.add_dependency 'rack', '>= 0.2.0'
  s.add_dependency 'eventmachine', '>= 0.8.1'
  unless WIN
    s.add_dependency 'daemons', '>= 1.0.9'
  end
 
  s.files = %w(COPYING CHANGELOG README Rakefile) +
                            Dir.glob("{benchmark,bin,doc,example,lib,spec,tasks}/**/*") +
                            Dir.glob("ext/**/*.{h,c,rb,rl}")
  
  if WIN
    s.files += ["lib/thin_parser.#{Config::CONFIG['DLEXT']}"]
  else
    s.extensions = FileList["ext/**/extconf.rb"].to_a
  end
  
  s.require_path = "lib"
  s.bindir = "bin"
end
 
Rake::GemPackageTask.new(spec) do |p|
  p.gem_spec = spec
end
 
task :tag_warn do
  puts "*" * 40
  puts "Don't forget to tag the release:"
  puts
  puts " git tag -m 'Tagging #{Thin::SERVER}' -a v#{Thin::VERSION::STRING}"
  puts
  puts "or run rake tag"
  puts "*" * 40
end
task :tag do
  sh "git tag -m 'Tagging #{Thin::SERVER}' -a v#{Thin::VERSION::STRING}"
end
task :gem => :tag_warn
 
namespace :gem do
  desc 'Upload gem to code.macournoyer.com'
  task :upload => :gem do
    upload "pkg/#{spec.full_name}.gem", 'gems'
    system 'ssh macournoyer@macournoyer.com "cd code.macournoyer.com && gem generate_index"'
  end
  
  namespace :upload do
    desc 'Upload the precompiled win32 gem to code.macournoyer.com'
    task :win do
      upload "pkg/#{spec.full_name}-x86-mswin32-60.gem", 'gems'
      system 'ssh macournoyer@macournoyer.com "cd code.macournoyer.com && gem generate_index"'
    end
 
    desc 'Upload gems (ruby & win32) to rubyforge.org'
    task :rubyforge => :gem do
      sh 'rubyforge login'
      sh "rubyforge add_release thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}.gem"
      sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}.gem"
      sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}-x86-mswin32-60.gem"
    end
  end
  
  desc 'Download the Windows gem from Kevin repo'
  task 'download:win' => 'pkg' do
    cd 'pkg' do
      `wget http://rubygems.bantamtech.com/ruby18/gems/#{spec.full_name}-x86-mswin32-60.gem`
    end
  end
end
 
task :install => [:clobber, :compile, :package] do
  sh "#{SUDO} #{gem} install pkg/#{spec.full_name}.gem"
end
 
task :uninstall => :clean do
  sh "#{SUDO} #{gem} uninstall -v #{Thin::VERSION::STRING} -x #{Thin::NAME}"
end
 
 
def gem
  RUBY_1_9 ? 'gem19' : 'gem'
end