thin 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of thin might be problematic. Click here for more details.

@@ -0,0 +1,18 @@
1
+ require 'erb'
2
+
3
+ MSG_TEMPLATE = File.dirname(__FILE__) + '/email.erb'
4
+ SEND_TO = %w(thin-ruby@googlegroups.com eventmachine-talk@rubyforge.org Rubymtl@lists.artengine.ca ruby-talk@ruby-lang.org)
5
+
6
+ desc 'Generate a template for the new version annoucement'
7
+ task :ann do
8
+ msg = ERB.new(File.read(MSG_TEMPLATE)).result(binding)
9
+
10
+ body = <<END_OF_MESSAGE
11
+ To: #{SEND_TO.join(', ')}
12
+ Subject: [ANN] Thin #{Thin::VERSION::STRING} #{Thin::VERSION::CODENAME} released
13
+
14
+ #{msg}
15
+ END_OF_MESSAGE
16
+
17
+ puts body
18
+ end
@@ -0,0 +1,16 @@
1
+ namespace :deploy do
2
+ task :site => %w(site:upload rdoc:upload)
3
+
4
+ desc 'Deploy on code.macournoyer.com'
5
+ task :alpha => %w(gem:upload deploy:site)
6
+
7
+ desc 'Deploy on rubyforge'
8
+ task :public => %w(gem:upload_rubyforge deploy:site)
9
+ end
10
+ desc 'Deploy on all servers'
11
+ task :deploy => %w(deploy:alpha deploy:public)
12
+
13
+ def upload(file, to, options={})
14
+ sh %{ssh macournoyer@macournoyer.com "rm -rf code.macournoyer.com/#{to}"} if options[:replace]
15
+ sh %{scp -rq #{file} macournoyer@macournoyer.com:code.macournoyer.com/#{to}}
16
+ end
@@ -0,0 +1,46 @@
1
+ Hey all,
2
+
3
+ Version <%= Thin::VERSION::STRING %> (codename <%= Thin::VERSION::CODENAME %>) of the fastest Ruby server is out!
4
+
5
+ http://code.macournoyer.com/thin/
6
+
7
+ == What's new?
8
+
9
+ Bug fix in daemon mode and speed boost for all!
10
+
11
+ * Don't read the full body, use direct streaming when sending response.
12
+ See: Response#each
13
+ As a result, the Content-Length can not be calculated anymore.
14
+ You have to do set this in your adapter. All frameworks do it anyway.
15
+ It improve memory usage and boost speed for low concurrency.
16
+ Thanks to Kent Sibilev and Ezra for their help on that one.
17
+ * Add 'Server' response header
18
+ * Fix --user and --group option not changing daemon process privileges
19
+
20
+ == Get it!
21
+
22
+ sudo gem install thin
23
+
24
+ Might take some time for the gem mirrors to be updated, try adding
25
+ --source http://code.macournoyer.com to the command if it doesn't work
26
+
27
+ If you installed a previous alpha version (if you have <%= Thin::VERSION::STRING %> already installed)
28
+ uninstall it before: sudo gem uninstall thin
29
+
30
+ WARNING:
31
+ Thin is still alpha software, if you use it on your server you understand the
32
+ risks that are involved.
33
+
34
+ == Contribute
35
+
36
+ If you're using Thin, let me know and I'll put your site on http://code.macournoyer.com/thin/users/
37
+
38
+ Thin is driven by an active community of passionate coders and benchmarkers. Please join us, contribute
39
+ or share some ideas in Thin Google Group: http://groups.google.com/group/thin-ruby/topics
40
+
41
+ Also on IRC: #thin on freenode
42
+
43
+ Thanks to all the people who contributed to Thin, EventMachine, Rack and Mongrel.
44
+
45
+ Marc-Andre Cournoyer
46
+ http://macournoyer.com/
@@ -0,0 +1,38 @@
1
+ CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM)
2
+
3
+ EXT_DIR = 'ext/thin_parser'
4
+ EXT_BUNDLE = "#{EXT_DIR}/thin_parser.#{Config::CONFIG['DLEXT']}"
5
+ EXT_FILES = FileList[
6
+ "#{EXT_DIR}/*.c",
7
+ "#{EXT_DIR}/*.h",
8
+ "#{EXT_DIR}/*.rl",
9
+ "#{EXT_DIR}/extconf.rb",
10
+ "#{EXT_DIR}/Makefile",
11
+ "lib"
12
+ ]
13
+
14
+ desc "Compile the Ragel state machines"
15
+ task :ragel do
16
+ Dir.chdir EXT_DIR do
17
+ target = "parser.c"
18
+ File.unlink target if File.exist? target
19
+ sh "ragel parser.rl | rlgen-cd -G2 -o #{target}"
20
+ raise "Failed to compile Ragel state machine" unless File.exist? target
21
+ end
22
+ end
23
+
24
+ desc "Compile the extensions"
25
+ task :compile => ["#{EXT_DIR}/Makefile", EXT_BUNDLE]
26
+
27
+ task :package => :compile
28
+
29
+ file "#{EXT_DIR}/Makefile" => ["#{EXT_DIR}/extconf.rb"] do
30
+ cd(EXT_DIR) { ruby "extconf.rb" }
31
+ end
32
+
33
+ file EXT_BUNDLE => EXT_FILES do
34
+ cd EXT_DIR do
35
+ sh(WIN ? 'nmake' : 'make')
36
+ end
37
+ cp EXT_BUNDLE, 'lib/'
38
+ end
@@ -0,0 +1,97 @@
1
+ require 'rake/gempackagetask'
2
+
3
+ task :clean => :clobber_package
4
+
5
+ spec = Gem::Specification.new do |s|
6
+ s.name = Thin::NAME
7
+ s.version = Thin::VERSION::STRING
8
+ s.platform = WIN ? Gem::Platform::CURRENT : Gem::Platform::RUBY
9
+ s.summary =
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)
15
+
16
+ s.required_ruby_version = '>= 1.8.6' # Makes sure the CGI eof fix is there
17
+
18
+ s.add_dependency 'rack', '>= 0.2.0'
19
+ s.add_dependency 'eventmachine', '>= 0.8.1'
20
+ unless WIN
21
+ s.add_dependency 'daemons', '>= 1.0.9'
22
+ end
23
+
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}")
27
+
28
+ if WIN
29
+ s.files += ["lib/thin_parser.#{Config::CONFIG['DLEXT']}"]
30
+ else
31
+ s.extensions = FileList["ext/**/extconf.rb"].to_a
32
+ end
33
+
34
+ s.require_path = "lib"
35
+ s.bindir = "bin"
36
+ end
37
+
38
+ Rake::GemPackageTask.new(spec) do |p|
39
+ p.gem_spec = spec
40
+ end
41
+
42
+ task :tag_warn do
43
+ puts "*" * 40
44
+ puts "Don't forget to tag the release:"
45
+ puts
46
+ puts " git tag -m 'Tagging #{Thin::SERVER}' -a v#{Thin::VERSION::STRING}"
47
+ puts
48
+ puts "or run rake tag"
49
+ puts "*" * 40
50
+ end
51
+ task :tag do
52
+ sh "git tag -m 'Tagging #{Thin::SERVER}' -a v#{Thin::VERSION::STRING}"
53
+ end
54
+ task :gem => :tag_warn
55
+
56
+ namespace :gem do
57
+ desc 'Upload gem to code.macournoyer.com'
58
+ task :upload => :gem do
59
+ upload "pkg/#{spec.full_name}.gem", 'gems'
60
+ system 'ssh macournoyer@macournoyer.com "cd code.macournoyer.com && gem generate_index"'
61
+ end
62
+
63
+ namespace :upload do
64
+ desc 'Upload the precompiled win32 gem to code.macournoyer.com'
65
+ task :win do
66
+ upload "pkg/#{spec.full_name}-x86-mswin32-60.gem", 'gems'
67
+ system 'ssh macournoyer@macournoyer.com "cd code.macournoyer.com && gem generate_index"'
68
+ end
69
+
70
+ desc 'Upload gem to rubyforge.org'
71
+ task :rubyforge => :gem do
72
+ sh 'rubyforge login'
73
+ sh "rubyforge add_release thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}.gem"
74
+ sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}.gem"
75
+ end
76
+
77
+ desc 'Upload the precompiled win32 gem to rubyforge.org'
78
+ task 'rubyforge:win' do
79
+ sh 'rubyforge login'
80
+ sh "rubyforge add_release thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}-x86-mswin32-60.gem"
81
+ sh "rubyforge add_file thin thin #{Thin::VERSION::STRING} pkg/#{spec.full_name}-x86-mswin32-60.gem"
82
+ end
83
+ end
84
+ end
85
+
86
+ task :install => [:clobber, :compile, :package] do
87
+ sh "#{SUDO} #{gem} install pkg/#{spec.full_name}.gem"
88
+ end
89
+
90
+ task :uninstall => :clean do
91
+ sh "#{SUDO} #{gem} uninstall -v #{Thin::VERSION::STRING} -x #{Thin::NAME}"
92
+ end
93
+
94
+
95
+ def gem
96
+ RUBY_1_9 ? 'gem19' : 'gem'
97
+ end
@@ -0,0 +1,25 @@
1
+ require 'rake/rdoctask'
2
+
3
+ CLEAN.include %w(doc/rdoc)
4
+
5
+ Rake::RDocTask.new do |rdoc|
6
+ rdoc.rdoc_dir = 'doc/rdoc'
7
+ rdoc.options += ['--quiet', '--title', Thin::NAME,
8
+ "--opname", "index.html",
9
+ "--line-numbers",
10
+ "--main", "README",
11
+ "--inline-source"]
12
+ rdoc.template = "site/rdoc.rb"
13
+ rdoc.main = "README"
14
+ rdoc.title = Thin::NAME
15
+ rdoc.rdoc_files.add %w(README) +
16
+ FileList['lib/**/*.rb'] +
17
+ FileList['bin/*']
18
+ end
19
+
20
+ namespace :rdoc do
21
+ desc 'Upload rdoc to code.macournoyer.com'
22
+ task :upload => :rdoc do
23
+ upload "doc/rdoc", 'thin/doc', :replace => true
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ namespace :site do
2
+ task :build do
3
+ mkdir_p 'tmp/site/images'
4
+ cd 'tmp/site' do
5
+ sh "SITE_ROOT='/thin' ruby ../../site/thin.rb --dump"
6
+ end
7
+ cp 'site/style.css', 'tmp/site'
8
+ cp_r Dir['site/images/*'], 'tmp/site/images'
9
+ end
10
+
11
+ desc 'Upload website to code.macournoyer.com'
12
+ task :upload => 'site:build' do
13
+ upload 'tmp/site/*', 'thin'
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ CLEAN.include %w(coverage tmp log)
2
+
3
+ if RUBY_1_9
4
+ task :spec do
5
+ warn 'RSpec not yet supporting Ruby 1.9, so cannot run the specs :('
6
+ end
7
+ else
8
+ # RSpec not yet working w/ Ruby 1.9
9
+ require 'spec/rake/spectask'
10
+
11
+ desc "Run all examples"
12
+ Spec::Rake::SpecTask.new('spec') do |t|
13
+ t.spec_files = FileList['spec/**/*_spec.rb']
14
+ end
15
+
16
+ task :check_spec_gems do
17
+ begin
18
+ require 'spec'
19
+ require 'benchmark_unit'
20
+ rescue LoadError
21
+ abort "To run specs, install rspec and benchmark_unit gems"
22
+ end
23
+ end
24
+
25
+ task :spec => [:check_spec_gems, :compile]
26
+ end
@@ -0,0 +1,15 @@
1
+ desc 'Show some stats about the code'
2
+ task :stats do
3
+ line_count = proc do |path|
4
+ Dir[path].collect { |f| File.open(f).readlines.reject { |l| l =~ /(^\s*(\#|\/\*))|^\s*$/ }.size }.inject(0){ |sum,n| sum += n }
5
+ end
6
+ lib = line_count['lib/**/*.rb']
7
+ ext = line_count['ext/**/*.{c,h}']
8
+ spec = line_count['spec/**/*.rb']
9
+ ratio = '%1.2f' % (spec.to_f / lib.to_f)
10
+
11
+ puts "#{lib.to_s.rjust(6)} LOC of lib"
12
+ puts "#{ext.to_s.rjust(6)} LOC of ext"
13
+ puts "#{spec.to_s.rjust(6)} LOC of spec"
14
+ puts "#{ratio.to_s.rjust(6)} ratio lib/spec"
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-Andre Cournoyer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-19 00:00:00 -05:00
12
+ date: 2008-01-25 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,7 @@ files:
57
57
  - benchmark/utils.rb
58
58
  - bin/thin
59
59
  - doc/benchmarks.txt
60
+ - example/adapter.rb
60
61
  - example/config.ru
61
62
  - example/thin.god
62
63
  - lib/rack
@@ -73,9 +74,11 @@ files:
73
74
  - lib/thin/request.rb
74
75
  - lib/thin/response.rb
75
76
  - lib/thin/server.rb
77
+ - lib/thin/stats.rb
76
78
  - lib/thin/statuses.rb
77
79
  - lib/thin/version.rb
78
80
  - lib/thin.rb
81
+ - lib/thin_parser.bundle
79
82
  - spec/cluster_spec.rb
80
83
  - spec/daemonizing_spec.rb
81
84
  - spec/headers_spec.rb
@@ -101,6 +104,7 @@ files:
101
104
  - spec/rails_app/config/initializers/inflections.rb
102
105
  - spec/rails_app/config/initializers/mime_types.rb
103
106
  - spec/rails_app/config/routes.rb
107
+ - spec/rails_app/log
104
108
  - spec/rails_app/public
105
109
  - spec/rails_app/public/404.html
106
110
  - spec/rails_app/public/422.html
@@ -135,10 +139,21 @@ files:
135
139
  - spec/rails_app/script/process/spawner
136
140
  - spec/rails_app/script/runner
137
141
  - spec/rails_app/script/server
142
+ - spec/rails_app/tmp
143
+ - spec/rails_app/tmp/pids
138
144
  - spec/request_spec.rb
139
145
  - spec/response_spec.rb
140
146
  - spec/server_spec.rb
141
147
  - spec/spec_helper.rb
148
+ - tasks/announce.rake
149
+ - tasks/deploy.rake
150
+ - tasks/email.erb
151
+ - tasks/ext.rake
152
+ - tasks/gem.rake
153
+ - tasks/rdoc.rake
154
+ - tasks/site.rake
155
+ - tasks/spec.rake
156
+ - tasks/stats.rake
142
157
  - ext/thin_parser/ext_help.h
143
158
  - ext/thin_parser/parser.h
144
159
  - ext/thin_parser/parser.c