thin 0.5.3-x86-mswin32-60

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.

Files changed (117) hide show
  1. data/CHANGELOG +40 -0
  2. data/COPYING +18 -0
  3. data/README +60 -0
  4. data/Rakefile +11 -0
  5. data/benchmark/simple.rb +48 -0
  6. data/bin/thin +123 -0
  7. data/doc/benchmarks.txt +86 -0
  8. data/doc/rdoc/classes/Process.html +181 -0
  9. data/doc/rdoc/classes/Rack.html +156 -0
  10. data/doc/rdoc/classes/Rack/Adapter.html +155 -0
  11. data/doc/rdoc/classes/Rack/Adapter/Rails.html +289 -0
  12. data/doc/rdoc/classes/Rack/Adapter/Rails/CGIWrapper.html +359 -0
  13. data/doc/rdoc/classes/Rack/Handler.html +155 -0
  14. data/doc/rdoc/classes/Rack/Handler/Thin.html +175 -0
  15. data/doc/rdoc/classes/Thin.html +164 -0
  16. data/doc/rdoc/classes/Thin/Cluster.html +399 -0
  17. data/doc/rdoc/classes/Thin/Connection.html +223 -0
  18. data/doc/rdoc/classes/Thin/Daemonizable.html +260 -0
  19. data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +197 -0
  20. data/doc/rdoc/classes/Thin/Headers.html +238 -0
  21. data/doc/rdoc/classes/Thin/InvalidRequest.html +144 -0
  22. data/doc/rdoc/classes/Thin/Logging.html +201 -0
  23. data/doc/rdoc/classes/Thin/Request.html +231 -0
  24. data/doc/rdoc/classes/Thin/Response.html +271 -0
  25. data/doc/rdoc/classes/Thin/Server.html +295 -0
  26. data/doc/rdoc/classes/Thin/StopServer.html +143 -0
  27. data/doc/rdoc/created.rid +1 -0
  28. data/doc/rdoc/files/README.html +226 -0
  29. data/doc/rdoc/files/bin/thin.html +245 -0
  30. data/doc/rdoc/files/lib/rack/adapter/rails_rb.html +146 -0
  31. data/doc/rdoc/files/lib/rack/handler/thin_rb.html +146 -0
  32. data/doc/rdoc/files/lib/thin/cluster_rb.html +146 -0
  33. data/doc/rdoc/files/lib/thin/connection_rb.html +145 -0
  34. data/doc/rdoc/files/lib/thin/daemonizing_rb.html +146 -0
  35. data/doc/rdoc/files/lib/thin/headers_rb.html +146 -0
  36. data/doc/rdoc/files/lib/thin/logging_rb.html +146 -0
  37. data/doc/rdoc/files/lib/thin/request_rb.html +145 -0
  38. data/doc/rdoc/files/lib/thin/response_rb.html +145 -0
  39. data/doc/rdoc/files/lib/thin/server_rb.html +145 -0
  40. data/doc/rdoc/files/lib/thin/statuses_rb.html +145 -0
  41. data/doc/rdoc/files/lib/thin/version_rb.html +145 -0
  42. data/doc/rdoc/files/lib/thin_rb.html +152 -0
  43. data/doc/rdoc/index.html +10 -0
  44. data/doc/rdoc/logo.gif +0 -0
  45. data/doc/rdoc/rdoc-style.css +55 -0
  46. data/example/config.ru +9 -0
  47. data/example/thin.god +72 -0
  48. data/ext/thin_parser/common.rl +54 -0
  49. data/ext/thin_parser/ext_help.h +14 -0
  50. data/ext/thin_parser/extconf.rb +6 -0
  51. data/ext/thin_parser/parser.c +1199 -0
  52. data/ext/thin_parser/parser.h +49 -0
  53. data/ext/thin_parser/parser.rl +143 -0
  54. data/ext/thin_parser/thin.c +424 -0
  55. data/lib/rack/adapter/rails.rb +155 -0
  56. data/lib/rack/handler/thin.rb +13 -0
  57. data/lib/thin.rb +36 -0
  58. data/lib/thin/cluster.rb +106 -0
  59. data/lib/thin/connection.rb +46 -0
  60. data/lib/thin/daemonizing.rb +112 -0
  61. data/lib/thin/headers.rb +37 -0
  62. data/lib/thin/logging.rb +23 -0
  63. data/lib/thin/request.rb +72 -0
  64. data/lib/thin/response.rb +48 -0
  65. data/lib/thin/server.rb +80 -0
  66. data/lib/thin/statuses.rb +43 -0
  67. data/lib/thin/version.rb +11 -0
  68. data/lib/thin_parser.so +0 -0
  69. data/spec/cluster_spec.rb +58 -0
  70. data/spec/daemonizing_spec.rb +93 -0
  71. data/spec/headers_spec.rb +35 -0
  72. data/spec/rack_rails_spec.rb +92 -0
  73. data/spec/rails_app/app/controllers/application.rb +10 -0
  74. data/spec/rails_app/app/controllers/simple_controller.rb +19 -0
  75. data/spec/rails_app/app/helpers/application_helper.rb +3 -0
  76. data/spec/rails_app/app/views/simple/index.html.erb +15 -0
  77. data/spec/rails_app/config/boot.rb +109 -0
  78. data/spec/rails_app/config/environment.rb +64 -0
  79. data/spec/rails_app/config/environments/development.rb +18 -0
  80. data/spec/rails_app/config/environments/production.rb +19 -0
  81. data/spec/rails_app/config/environments/test.rb +22 -0
  82. data/spec/rails_app/config/initializers/inflections.rb +10 -0
  83. data/spec/rails_app/config/initializers/mime_types.rb +5 -0
  84. data/spec/rails_app/config/routes.rb +35 -0
  85. data/spec/rails_app/public/404.html +30 -0
  86. data/spec/rails_app/public/422.html +30 -0
  87. data/spec/rails_app/public/500.html +30 -0
  88. data/spec/rails_app/public/dispatch.cgi +10 -0
  89. data/spec/rails_app/public/dispatch.fcgi +24 -0
  90. data/spec/rails_app/public/dispatch.rb +10 -0
  91. data/spec/rails_app/public/favicon.ico +0 -0
  92. data/spec/rails_app/public/images/rails.png +0 -0
  93. data/spec/rails_app/public/index.html +277 -0
  94. data/spec/rails_app/public/javascripts/application.js +2 -0
  95. data/spec/rails_app/public/javascripts/controls.js +963 -0
  96. data/spec/rails_app/public/javascripts/dragdrop.js +972 -0
  97. data/spec/rails_app/public/javascripts/effects.js +1120 -0
  98. data/spec/rails_app/public/javascripts/prototype.js +4225 -0
  99. data/spec/rails_app/public/robots.txt +5 -0
  100. data/spec/rails_app/script/about +3 -0
  101. data/spec/rails_app/script/console +3 -0
  102. data/spec/rails_app/script/destroy +3 -0
  103. data/spec/rails_app/script/generate +3 -0
  104. data/spec/rails_app/script/performance/benchmarker +3 -0
  105. data/spec/rails_app/script/performance/profiler +3 -0
  106. data/spec/rails_app/script/performance/request +3 -0
  107. data/spec/rails_app/script/plugin +3 -0
  108. data/spec/rails_app/script/process/inspector +3 -0
  109. data/spec/rails_app/script/process/reaper +3 -0
  110. data/spec/rails_app/script/process/spawner +3 -0
  111. data/spec/rails_app/script/runner +3 -0
  112. data/spec/rails_app/script/server +3 -0
  113. data/spec/request_spec.rb +258 -0
  114. data/spec/response_spec.rb +56 -0
  115. data/spec/server_spec.rb +75 -0
  116. data/spec/spec_helper.rb +127 -0
  117. metadata +219 -0
@@ -0,0 +1,127 @@
1
+ require 'rubygems'
2
+ require File.dirname(__FILE__) + '/../lib/thin'
3
+ require 'spec'
4
+ require 'benchmark'
5
+ require 'timeout'
6
+ require 'fileutils'
7
+
8
+ include Thin
9
+
10
+ FileUtils.mkdir_p File.dirname(__FILE__) + '/../log'
11
+
12
+ class TestRequest < Thin::Request
13
+ def initialize(path, verb='GET', params={})
14
+ @path = path
15
+ @verb = verb.to_s.upcase
16
+ @params = {
17
+ 'HTTP_HOST' => 'localhost:3000',
18
+ 'REQUEST_URI' => @path,
19
+ 'REQUEST_PATH' => @path,
20
+ 'REQUEST_METHOD' => @verb,
21
+ 'SCRIPT_NAME' => @path
22
+ }.merge(params)
23
+
24
+ @body = "#{@verb} #{path} HTTP/1.1"
25
+ end
26
+ end
27
+
28
+ module Matchers
29
+ class BeFasterThen
30
+ def initialize(max_time)
31
+ @max_time = max_time
32
+ end
33
+
34
+ def matches?(target)
35
+ @target = target
36
+ @time = Benchmark.measure { @target.call }.real * 1000
37
+ @time <= @max_time
38
+ end
39
+
40
+ def failure_message(less_more=:less)
41
+ "took #{@time} ms, should take #{less_more} then #{@max_time} ms"
42
+ end
43
+
44
+ def negative_failure_message
45
+ failure_message :more
46
+ end
47
+ end
48
+
49
+ class ValidateWithLint
50
+ def matches?(request)
51
+ @request = request
52
+ Rack::Lint.new(proc{[200, {'Content-Type' => 'text/html'}, []]}).call(@request.env)
53
+ true
54
+ rescue Rack::Lint::LintError => e
55
+ @message = e.message
56
+ false
57
+ end
58
+
59
+ def failure_message(negation=nil)
60
+ "should#{negation} validate with Rack Lint"
61
+ end
62
+
63
+ def negative_failure_message
64
+ failure_message ' not'
65
+ end
66
+ end
67
+
68
+ class TakeLessThen
69
+ def initialize(time)
70
+ @time = time
71
+ end
72
+
73
+ def matches?(proc)
74
+ Timeout.timeout(@time) { proc.call }
75
+ true
76
+ rescue Timeout::Error
77
+ false
78
+ end
79
+
80
+ def failure_message(negation=nil)
81
+ "should#{negation} take less then #{@time} sec to run"
82
+ end
83
+
84
+ def negative_failure_message
85
+ failure_message ' not'
86
+ end
87
+ end
88
+
89
+ # Actual matchers that are exposed.
90
+
91
+ def be_faster_then(time)
92
+ BeFasterThen.new(time)
93
+ end
94
+
95
+ def validate_with_lint
96
+ ValidateWithLint.new
97
+ end
98
+
99
+ def take_less_then(time)
100
+ TakeLessThen.new(time)
101
+ end
102
+ end
103
+
104
+ module Helpers
105
+ # Silences any stream for the duration of the block.
106
+ #
107
+ # silence_stream(STDOUT) do
108
+ # puts 'This will never be seen'
109
+ # end
110
+ #
111
+ # puts 'But this will'
112
+ #
113
+ # (Taken from ActiveSupport)
114
+ def silence_stream(stream)
115
+ old_stream = stream.dup
116
+ stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
117
+ stream.sync = true
118
+ yield
119
+ ensure
120
+ stream.reopen(old_stream)
121
+ end
122
+ end
123
+
124
+ Spec::Runner.configure do |config|
125
+ config.include Matchers
126
+ config.include Helpers
127
+ end
metadata ADDED
@@ -0,0 +1,219 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: thin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.3
5
+ platform: x86-mswin32-60
6
+ authors:
7
+ - Marc-Andre Cournoyer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-01-18 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rack
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.2.0
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: eventmachine
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 0.8.1
32
+ version:
33
+ description: A thin and fast web server
34
+ email: macournoyer@gmail.com
35
+ executables:
36
+ - thin
37
+ extensions: []
38
+
39
+ extra_rdoc_files: []
40
+
41
+ files:
42
+ - COPYING
43
+ - CHANGELOG
44
+ - README
45
+ - Rakefile
46
+ - benchmark/simple.rb
47
+ - bin/thin
48
+ - doc/benchmarks.txt
49
+ - doc/rdoc
50
+ - doc/rdoc/classes
51
+ - doc/rdoc/classes/Process.html
52
+ - doc/rdoc/classes/Rack
53
+ - doc/rdoc/classes/Rack/Adapter
54
+ - doc/rdoc/classes/Rack/Adapter/Rails
55
+ - doc/rdoc/classes/Rack/Adapter/Rails/CGIWrapper.html
56
+ - doc/rdoc/classes/Rack/Adapter/Rails.html
57
+ - doc/rdoc/classes/Rack/Adapter.html
58
+ - doc/rdoc/classes/Rack/Handler
59
+ - doc/rdoc/classes/Rack/Handler/Thin.html
60
+ - doc/rdoc/classes/Rack/Handler.html
61
+ - doc/rdoc/classes/Rack.html
62
+ - doc/rdoc/classes/Thin
63
+ - doc/rdoc/classes/Thin/Cluster.html
64
+ - doc/rdoc/classes/Thin/Connection.html
65
+ - doc/rdoc/classes/Thin/Daemonizable
66
+ - doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html
67
+ - doc/rdoc/classes/Thin/Daemonizable.html
68
+ - doc/rdoc/classes/Thin/Headers.html
69
+ - doc/rdoc/classes/Thin/InvalidRequest.html
70
+ - doc/rdoc/classes/Thin/Logging.html
71
+ - doc/rdoc/classes/Thin/Request.html
72
+ - doc/rdoc/classes/Thin/Response.html
73
+ - doc/rdoc/classes/Thin/Server.html
74
+ - doc/rdoc/classes/Thin/StopServer.html
75
+ - doc/rdoc/classes/Thin.html
76
+ - doc/rdoc/created.rid
77
+ - doc/rdoc/files
78
+ - doc/rdoc/files/bin
79
+ - doc/rdoc/files/bin/thin.html
80
+ - doc/rdoc/files/lib
81
+ - doc/rdoc/files/lib/rack
82
+ - doc/rdoc/files/lib/rack/adapter
83
+ - doc/rdoc/files/lib/rack/adapter/rails_rb.html
84
+ - doc/rdoc/files/lib/rack/handler
85
+ - doc/rdoc/files/lib/rack/handler/thin_rb.html
86
+ - doc/rdoc/files/lib/thin
87
+ - doc/rdoc/files/lib/thin/cluster_rb.html
88
+ - doc/rdoc/files/lib/thin/connection_rb.html
89
+ - doc/rdoc/files/lib/thin/daemonizing_rb.html
90
+ - doc/rdoc/files/lib/thin/headers_rb.html
91
+ - doc/rdoc/files/lib/thin/logging_rb.html
92
+ - doc/rdoc/files/lib/thin/request_rb.html
93
+ - doc/rdoc/files/lib/thin/response_rb.html
94
+ - doc/rdoc/files/lib/thin/server_rb.html
95
+ - doc/rdoc/files/lib/thin/statuses_rb.html
96
+ - doc/rdoc/files/lib/thin/version_rb.html
97
+ - doc/rdoc/files/lib/thin_rb.html
98
+ - doc/rdoc/files/README.html
99
+ - doc/rdoc/index.html
100
+ - doc/rdoc/logo.gif
101
+ - doc/rdoc/rdoc-style.css
102
+ - example/config.ru
103
+ - example/thin.god
104
+ - lib/rack
105
+ - lib/rack/adapter
106
+ - lib/rack/adapter/rails.rb
107
+ - lib/rack/handler
108
+ - lib/rack/handler/thin.rb
109
+ - lib/thin
110
+ - lib/thin/cluster.rb
111
+ - lib/thin/connection.rb
112
+ - lib/thin/daemonizing.rb
113
+ - lib/thin/headers.rb
114
+ - lib/thin/logging.rb
115
+ - lib/thin/request.rb
116
+ - lib/thin/response.rb
117
+ - lib/thin/server.rb
118
+ - lib/thin/statuses.rb
119
+ - lib/thin/version.rb
120
+ - lib/thin.rb
121
+ - spec/cluster_spec.rb
122
+ - spec/daemonizing_spec.rb
123
+ - spec/headers_spec.rb
124
+ - spec/rack_rails_spec.rb
125
+ - spec/rails_app
126
+ - spec/rails_app/app
127
+ - spec/rails_app/app/controllers
128
+ - spec/rails_app/app/controllers/application.rb
129
+ - spec/rails_app/app/controllers/simple_controller.rb
130
+ - spec/rails_app/app/helpers
131
+ - spec/rails_app/app/helpers/application_helper.rb
132
+ - spec/rails_app/app/views
133
+ - spec/rails_app/app/views/simple
134
+ - spec/rails_app/app/views/simple/index.html.erb
135
+ - spec/rails_app/config
136
+ - spec/rails_app/config/boot.rb
137
+ - spec/rails_app/config/environment.rb
138
+ - spec/rails_app/config/environments
139
+ - spec/rails_app/config/environments/development.rb
140
+ - spec/rails_app/config/environments/production.rb
141
+ - spec/rails_app/config/environments/test.rb
142
+ - spec/rails_app/config/initializers
143
+ - spec/rails_app/config/initializers/inflections.rb
144
+ - spec/rails_app/config/initializers/mime_types.rb
145
+ - spec/rails_app/config/routes.rb
146
+ - spec/rails_app/public
147
+ - spec/rails_app/public/404.html
148
+ - spec/rails_app/public/422.html
149
+ - spec/rails_app/public/500.html
150
+ - spec/rails_app/public/dispatch.cgi
151
+ - spec/rails_app/public/dispatch.fcgi
152
+ - spec/rails_app/public/dispatch.rb
153
+ - spec/rails_app/public/favicon.ico
154
+ - spec/rails_app/public/images
155
+ - spec/rails_app/public/images/rails.png
156
+ - spec/rails_app/public/index.html
157
+ - spec/rails_app/public/javascripts
158
+ - spec/rails_app/public/javascripts/application.js
159
+ - spec/rails_app/public/javascripts/controls.js
160
+ - spec/rails_app/public/javascripts/dragdrop.js
161
+ - spec/rails_app/public/javascripts/effects.js
162
+ - spec/rails_app/public/javascripts/prototype.js
163
+ - spec/rails_app/public/robots.txt
164
+ - spec/rails_app/script
165
+ - spec/rails_app/script/about
166
+ - spec/rails_app/script/console
167
+ - spec/rails_app/script/destroy
168
+ - spec/rails_app/script/generate
169
+ - spec/rails_app/script/performance
170
+ - spec/rails_app/script/performance/benchmarker
171
+ - spec/rails_app/script/performance/profiler
172
+ - spec/rails_app/script/performance/request
173
+ - spec/rails_app/script/plugin
174
+ - spec/rails_app/script/process
175
+ - spec/rails_app/script/process/inspector
176
+ - spec/rails_app/script/process/reaper
177
+ - spec/rails_app/script/process/spawner
178
+ - spec/rails_app/script/runner
179
+ - spec/rails_app/script/server
180
+ - spec/request_spec.rb
181
+ - spec/response_spec.rb
182
+ - spec/server_spec.rb
183
+ - spec/spec_helper.rb
184
+ - ext/thin_parser/ext_help.h
185
+ - ext/thin_parser/parser.h
186
+ - ext/thin_parser/parser.c
187
+ - ext/thin_parser/thin.c
188
+ - ext/thin_parser/extconf.rb
189
+ - ext/thin_parser/common.rl
190
+ - ext/thin_parser/parser.rl
191
+ - lib/thin_parser.so
192
+ has_rdoc: false
193
+ homepage: http://code.macournoyer.com/thin/
194
+ post_install_message:
195
+ rdoc_options: []
196
+
197
+ require_paths:
198
+ - lib
199
+ required_ruby_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ version: 1.8.6
204
+ version:
205
+ required_rubygems_version: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: "0"
210
+ version:
211
+ requirements: []
212
+
213
+ rubyforge_project:
214
+ rubygems_version: 1.0.1
215
+ signing_key:
216
+ specification_version: 2
217
+ summary: A thin and fast web server
218
+ test_files: []
219
+