hayabusa 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +20 -0
  4. data/Gemfile.lock +59 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.rdoc +19 -0
  7. data/Rakefile +49 -0
  8. data/VERSION +1 -0
  9. data/bin/check_running.rb +69 -0
  10. data/bin/hayabusa_benchmark.rb +82 -0
  11. data/bin/hayabusa_cgi.rb +84 -0
  12. data/bin/hayabusa_fcgi.fcgi +159 -0
  13. data/bin/hayabusa_fcgi.rb +159 -0
  14. data/bin/knjappserver_start.rb +42 -0
  15. data/conf/apache2_cgi_rhtml_conf.conf +10 -0
  16. data/conf/apache2_fcgi_rhtml_conf.conf +22 -0
  17. data/hayabusa.gemspec +151 -0
  18. data/lib/hayabusa.rb +518 -0
  19. data/lib/hayabusa_cgi_session.rb +128 -0
  20. data/lib/hayabusa_cgi_tools.rb +102 -0
  21. data/lib/hayabusa_custom_io.rb +22 -0
  22. data/lib/hayabusa_database.rb +125 -0
  23. data/lib/hayabusa_erb_handler.rb +27 -0
  24. data/lib/hayabusa_ext/cleaner.rb +140 -0
  25. data/lib/hayabusa_ext/cmdline.rb +52 -0
  26. data/lib/hayabusa_ext/errors.rb +135 -0
  27. data/lib/hayabusa_ext/logging.rb +404 -0
  28. data/lib/hayabusa_ext/mailing.rb +158 -0
  29. data/lib/hayabusa_ext/sessions.rb +71 -0
  30. data/lib/hayabusa_ext/threadding.rb +96 -0
  31. data/lib/hayabusa_ext/threadding_timeout.rb +101 -0
  32. data/lib/hayabusa_ext/translations.rb +43 -0
  33. data/lib/hayabusa_ext/web.rb +190 -0
  34. data/lib/hayabusa_http_server.rb +102 -0
  35. data/lib/hayabusa_http_session.rb +361 -0
  36. data/lib/hayabusa_http_session_contentgroup.rb +176 -0
  37. data/lib/hayabusa_http_session_page_environment.rb +66 -0
  38. data/lib/hayabusa_http_session_post_multipart.rb +135 -0
  39. data/lib/hayabusa_http_session_request.rb +219 -0
  40. data/lib/hayabusa_http_session_response.rb +144 -0
  41. data/lib/hayabusa_models.rb +8 -0
  42. data/lib/kernel_ext/gettext_methods.rb +22 -0
  43. data/lib/kernel_ext/magic_methods.rb +61 -0
  44. data/lib/models/log.rb +130 -0
  45. data/lib/models/log_access.rb +88 -0
  46. data/lib/models/log_data.rb +27 -0
  47. data/lib/models/log_data_link.rb +3 -0
  48. data/lib/models/log_data_value.rb +21 -0
  49. data/lib/models/log_link.rb +65 -0
  50. data/lib/models/session.rb +35 -0
  51. data/pages/benchmark.rhtml +0 -0
  52. data/pages/benchmark_print.rhtml +14 -0
  53. data/pages/benchmark_simple.rhtml +3 -0
  54. data/pages/benchmark_threadded_content.rhtml +21 -0
  55. data/pages/debug_database_connections.rhtml +46 -0
  56. data/pages/debug_http_sessions.rhtml +40 -0
  57. data/pages/debug_memory_usage.rhtml +16 -0
  58. data/pages/error_notfound.rhtml +12 -0
  59. data/pages/logs_latest.rhtml +57 -0
  60. data/pages/logs_show.rhtml +32 -0
  61. data/pages/spec.rhtml +41 -0
  62. data/pages/spec_post.rhtml +3 -0
  63. data/pages/spec_test_multiple_clients.rhtml +3 -0
  64. data/pages/spec_thread_joins.rhtml +21 -0
  65. data/pages/spec_threadded_content.rhtml +40 -0
  66. data/pages/tests.rhtml +14 -0
  67. data/spec/cgi_spec.rb +47 -0
  68. data/spec/custom_urls_spec.rb +35 -0
  69. data/spec/fcgi_multiple_processes_spec.rb +32 -0
  70. data/spec/fcgi_spec.rb +69 -0
  71. data/spec/hayabusa_spec.rb +194 -0
  72. data/spec/spec_helper.rb +12 -0
  73. data/tests/cgi_test/config_cgi.rb +6 -0
  74. data/tests/cgi_test/threadded_content_test.rhtml +23 -0
  75. data/tests/cgi_test/vars_get_test.rhtml +4 -0
  76. data/tests/cgi_test/vars_header_test.rhtml +3 -0
  77. data/tests/cgi_test/vars_post_test.rhtml +4 -0
  78. data/tests/fcgi_test/config_fcgi.rb +6 -0
  79. data/tests/fcgi_test/index.rhtml +3 -0
  80. data/tests/fcgi_test/sleeper.rhtml +4 -0
  81. data/tests/fcgi_test/threadded_content_test.rhtml +23 -0
  82. data/tests/fcgi_test/vars_get_test.rhtml +4 -0
  83. data/tests/fcgi_test/vars_header_test.rhtml +3 -0
  84. data/tests/fcgi_test/vars_post_test.rhtml +4 -0
  85. metadata +257 -0
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'hayabusa'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
@@ -0,0 +1,6 @@
1
+ Hayabusa::CGI_CONF = {
2
+ :hayabusa => {
3
+ :title => "Cgi_test",
4
+ :doc_root => File.realpath(File.dirname(__FILE__))
5
+ }
6
+ }
@@ -0,0 +1,23 @@
1
+ <%
2
+ print "1"
3
+
4
+ _hb.threadded_content do
5
+ print "2"
6
+ sleep 0.5
7
+ end
8
+
9
+ print "3"
10
+
11
+ _hb.threadded_content do
12
+ print "4"
13
+
14
+ _hb.threadded_content do
15
+ print "5"
16
+ sleep 0.2
17
+ end
18
+
19
+ sleep 0.3
20
+ end
21
+
22
+ print "6"
23
+ %>
@@ -0,0 +1,4 @@
1
+ <%
2
+ require "json"
3
+ print JSON.generate(_get)
4
+ %>
@@ -0,0 +1,3 @@
1
+ <%
2
+ _hb.header("TestHeader", "TestValue")
3
+ %>
@@ -0,0 +1,4 @@
1
+ <%
2
+ require "json"
3
+ print JSON.generate(_post)
4
+ %>
@@ -0,0 +1,6 @@
1
+ Hayabusa::FCGI_CONF = {
2
+ :hayabusa => {
3
+ :title => "Fcgi_test",
4
+ :doc_root => File.realpath(File.dirname(__FILE__))
5
+ }
6
+ }
@@ -0,0 +1,3 @@
1
+ <%
2
+ print "Dette er en test #{Time.now}."
3
+ %>
@@ -0,0 +1,4 @@
1
+ <%
2
+ sleep 0.7
3
+ print Process.pid
4
+ %>
@@ -0,0 +1,23 @@
1
+ <%
2
+ print "1"
3
+
4
+ _hb.threadded_content do
5
+ print "2"
6
+ sleep 0.5
7
+ end
8
+
9
+ print "3"
10
+
11
+ _hb.threadded_content do
12
+ print "4"
13
+
14
+ _hb.threadded_content do
15
+ print "5"
16
+ sleep 0.2
17
+ end
18
+
19
+ sleep 0.3
20
+ end
21
+
22
+ print "6"
23
+ %>
@@ -0,0 +1,4 @@
1
+ <%
2
+ require "json"
3
+ print JSON.generate(_get)
4
+ %>
@@ -0,0 +1,3 @@
1
+ <%
2
+ _hb.header("TestHeader", "TestValue")
3
+ %>
@@ -0,0 +1,4 @@
1
+ <%
2
+ require "json"
3
+ print JSON.generate(_post)
4
+ %>
metadata ADDED
@@ -0,0 +1,257 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hayabusa
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Kasper Johansen
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-08-16 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: knjrbfw
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: erubis
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: mail
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: datet
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: http2
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: json
73
+ requirement: &id006 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
83
+ name: rspec
84
+ requirement: &id007 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 2.3.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: *id007
93
+ - !ruby/object:Gem::Dependency
94
+ name: bundler
95
+ requirement: &id008 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 1.0.0
101
+ type: :development
102
+ prerelease: false
103
+ version_requirements: *id008
104
+ - !ruby/object:Gem::Dependency
105
+ name: jeweler
106
+ requirement: &id009 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ~>
110
+ - !ruby/object:Gem::Version
111
+ version: 1.6.3
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: *id009
115
+ - !ruby/object:Gem::Dependency
116
+ name: sqlite3
117
+ requirement: &id010 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: "0"
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: *id010
126
+ description: A threadded web/app-server that focuses on threadding, shared ressources, speed and more.
127
+ email: k@spernj.org
128
+ executables:
129
+ - check_running.rb
130
+ - hayabusa_benchmark.rb
131
+ - hayabusa_cgi.rb
132
+ - hayabusa_fcgi.fcgi
133
+ - hayabusa_fcgi.rb
134
+ - knjappserver_start.rb
135
+ extensions: []
136
+
137
+ extra_rdoc_files:
138
+ - LICENSE.txt
139
+ - README.rdoc
140
+ files:
141
+ - .document
142
+ - .rspec
143
+ - Gemfile
144
+ - Gemfile.lock
145
+ - LICENSE.txt
146
+ - README.rdoc
147
+ - Rakefile
148
+ - VERSION
149
+ - bin/check_running.rb
150
+ - bin/hayabusa_benchmark.rb
151
+ - bin/hayabusa_cgi.rb
152
+ - bin/hayabusa_fcgi.fcgi
153
+ - bin/hayabusa_fcgi.rb
154
+ - bin/knjappserver_start.rb
155
+ - conf/apache2_cgi_rhtml_conf.conf
156
+ - conf/apache2_fcgi_rhtml_conf.conf
157
+ - hayabusa.gemspec
158
+ - lib/hayabusa.rb
159
+ - lib/hayabusa_cgi_session.rb
160
+ - lib/hayabusa_cgi_tools.rb
161
+ - lib/hayabusa_custom_io.rb
162
+ - lib/hayabusa_database.rb
163
+ - lib/hayabusa_erb_handler.rb
164
+ - lib/hayabusa_ext/cleaner.rb
165
+ - lib/hayabusa_ext/cmdline.rb
166
+ - lib/hayabusa_ext/errors.rb
167
+ - lib/hayabusa_ext/logging.rb
168
+ - lib/hayabusa_ext/mailing.rb
169
+ - lib/hayabusa_ext/sessions.rb
170
+ - lib/hayabusa_ext/threadding.rb
171
+ - lib/hayabusa_ext/threadding_timeout.rb
172
+ - lib/hayabusa_ext/translations.rb
173
+ - lib/hayabusa_ext/web.rb
174
+ - lib/hayabusa_http_server.rb
175
+ - lib/hayabusa_http_session.rb
176
+ - lib/hayabusa_http_session_contentgroup.rb
177
+ - lib/hayabusa_http_session_page_environment.rb
178
+ - lib/hayabusa_http_session_post_multipart.rb
179
+ - lib/hayabusa_http_session_request.rb
180
+ - lib/hayabusa_http_session_response.rb
181
+ - lib/hayabusa_models.rb
182
+ - lib/kernel_ext/gettext_methods.rb
183
+ - lib/kernel_ext/magic_methods.rb
184
+ - lib/models/log.rb
185
+ - lib/models/log_access.rb
186
+ - lib/models/log_data.rb
187
+ - lib/models/log_data_link.rb
188
+ - lib/models/log_data_value.rb
189
+ - lib/models/log_link.rb
190
+ - lib/models/session.rb
191
+ - pages/benchmark.rhtml
192
+ - pages/benchmark_print.rhtml
193
+ - pages/benchmark_simple.rhtml
194
+ - pages/benchmark_threadded_content.rhtml
195
+ - pages/debug_database_connections.rhtml
196
+ - pages/debug_http_sessions.rhtml
197
+ - pages/debug_memory_usage.rhtml
198
+ - pages/error_notfound.rhtml
199
+ - pages/logs_latest.rhtml
200
+ - pages/logs_show.rhtml
201
+ - pages/spec.rhtml
202
+ - pages/spec_post.rhtml
203
+ - pages/spec_test_multiple_clients.rhtml
204
+ - pages/spec_thread_joins.rhtml
205
+ - pages/spec_threadded_content.rhtml
206
+ - pages/tests.rhtml
207
+ - spec/cgi_spec.rb
208
+ - spec/custom_urls_spec.rb
209
+ - spec/fcgi_multiple_processes_spec.rb
210
+ - spec/fcgi_spec.rb
211
+ - spec/hayabusa_spec.rb
212
+ - spec/spec_helper.rb
213
+ - tests/cgi_test/config_cgi.rb
214
+ - tests/cgi_test/threadded_content_test.rhtml
215
+ - tests/cgi_test/vars_get_test.rhtml
216
+ - tests/cgi_test/vars_header_test.rhtml
217
+ - tests/cgi_test/vars_post_test.rhtml
218
+ - tests/fcgi_test/config_fcgi.rb
219
+ - tests/fcgi_test/index.rhtml
220
+ - tests/fcgi_test/sleeper.rhtml
221
+ - tests/fcgi_test/threadded_content_test.rhtml
222
+ - tests/fcgi_test/vars_get_test.rhtml
223
+ - tests/fcgi_test/vars_header_test.rhtml
224
+ - tests/fcgi_test/vars_post_test.rhtml
225
+ has_rdoc: true
226
+ homepage: http://github.com/kaspernj/hayabusa
227
+ licenses:
228
+ - MIT
229
+ post_install_message:
230
+ rdoc_options: []
231
+
232
+ require_paths:
233
+ - lib
234
+ required_ruby_version: !ruby/object:Gem::Requirement
235
+ none: false
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ hash: 3557679821494000327
240
+ segments:
241
+ - 0
242
+ version: "0"
243
+ required_rubygems_version: !ruby/object:Gem::Requirement
244
+ none: false
245
+ requirements:
246
+ - - ">="
247
+ - !ruby/object:Gem::Version
248
+ version: "0"
249
+ requirements: []
250
+
251
+ rubyforge_project:
252
+ rubygems_version: 1.6.2
253
+ signing_key:
254
+ specification_version: 3
255
+ summary: A threadded web/app-server that supports stand-alone, CGI and FCGI-modes.
256
+ test_files: []
257
+