hayabusa 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +4 -4
  3. data/Rakefile +0 -14
  4. data/bin/hayabusa_fcgi.fcgi +1 -0
  5. data/lib/hayabusa.rb +119 -117
  6. data/lib/hayabusa_database.rb +84 -84
  7. data/lib/hayabusa_datarow.rb +873 -0
  8. data/lib/hayabusa_objects.rb +1455 -0
  9. data/lib/hayabusa_revision.rb +347 -0
  10. data/lib/models/log.rb +27 -27
  11. data/lib/models/log_access.rb +20 -20
  12. data/lib/models/log_data.rb +6 -6
  13. data/lib/models/log_data_link.rb +2 -2
  14. data/lib/models/log_data_value.rb +5 -5
  15. data/lib/models/log_link.rb +12 -12
  16. data/lib/models/session.rb +6 -6
  17. metadata +75 -57
  18. data/.document +0 -5
  19. data/.rspec +0 -1
  20. data/Gemfile +0 -25
  21. data/Gemfile.lock +0 -105
  22. data/VERSION +0 -1
  23. data/bin/hayabusa_fcgi.fcgi +0 -42
  24. data/conf/apache2_cgi_rhtml_conf.conf +0 -10
  25. data/conf/apache2_fcgi_rhtml_conf.conf +0 -22
  26. data/conf/apache2_hayabusa_conf.conf +0 -15
  27. data/hayabusa.gemspec +0 -171
  28. data/pages/benchmark.rhtml +0 -0
  29. data/pages/benchmark_print.rhtml +0 -14
  30. data/pages/benchmark_simple.rhtml +0 -3
  31. data/pages/benchmark_threadded_content.rhtml +0 -21
  32. data/pages/config_cgi.rb +0 -22
  33. data/pages/config_fcgi.rb +0 -22
  34. data/pages/debug_database_connections.rhtml +0 -46
  35. data/pages/debug_http_sessions.rhtml +0 -40
  36. data/pages/debug_memory_usage.rhtml +0 -39
  37. data/pages/error_notfound.rhtml +0 -12
  38. data/pages/image.png +0 -0
  39. data/pages/logs_latest.rhtml +0 -57
  40. data/pages/logs_show.rhtml +0 -32
  41. data/pages/spec.rhtml +0 -41
  42. data/pages/spec_exit.rhtml +0 -5
  43. data/pages/spec_multiple_threads.rhtml +0 -18
  44. data/pages/spec_sleeper.rhtml +0 -4
  45. data/pages/spec_test_multiple_clients.rhtml +0 -3
  46. data/pages/spec_thread_joins.rhtml +0 -29
  47. data/pages/spec_threadded_content.rhtml +0 -40
  48. data/pages/spec_vars_get.rhtml +0 -4
  49. data/pages/spec_vars_header.rhtml +0 -3
  50. data/pages/spec_vars_post.rhtml +0 -4
  51. data/pages/spec_vars_post_fileupload.rhtml +0 -19
  52. data/pages/testpic.jpeg +0 -0
  53. data/pages/tests.rhtml +0 -14
  54. data/pages/threadded_content_test.rhtml +0 -23
  55. data/spec/fcgi_multiple_processes_spec.rb +0 -104
  56. data/spec/hayabusa_spec.rb +0 -423
  57. data/spec/spec_helper.rb +0 -12
  58. data/spec/test_upload.xlsx +0 -0
@@ -1,8 +1,8 @@
1
- class Hayabusa::Models::Log_link < Knj::Datarow
1
+ class Hayabusa::Models::Log_link < Hayabusa::Datarow
2
2
  has_one [
3
3
  {:class => :Log, :col => :log_id, :method => :log}
4
4
  ]
5
-
5
+
6
6
  def self.list(d, &block)
7
7
  if d.args["count"]
8
8
  sql = "SELECT COUNT(id) AS count FROM #{table} WHERE 1=1"
@@ -11,11 +11,11 @@ class Hayabusa::Models::Log_link < Knj::Datarow
11
11
  else
12
12
  sql = "SELECT * FROM #{table} WHERE 1=1"
13
13
  end
14
-
14
+
15
15
  q_args = nil
16
16
  ret = self.list_helper(d)
17
17
  sql << ret[:sql_joins]
18
-
18
+
19
19
  d.args.each do |key, val|
20
20
  case key
21
21
  when "object_class"
@@ -28,17 +28,17 @@ class Hayabusa::Models::Log_link < Knj::Datarow
28
28
  raise "Invalid key: #{key}."
29
29
  end
30
30
  end
31
-
31
+
32
32
  sql << ret[:sql_where]
33
-
33
+
34
34
  return d.db.query(sql).fetch[:count].to_i if count
35
-
35
+
36
36
  sql << ret[:sql_order]
37
37
  sql << ret[:sql_limit]
38
-
38
+
39
39
  return d.ob.list_bysql(:Log_link, sql, q_args, &block)
40
40
  end
41
-
41
+
42
42
  def self.add(d)
43
43
  if d.data.has_key?(:object)
44
44
  class_data_id = d.ob.static(:Log_data_value, :force, d.data[:object].class.name)
@@ -46,10 +46,10 @@ class Hayabusa::Models::Log_link < Knj::Datarow
46
46
  d.data[:object_id] = d.data[:object].id
47
47
  d.data.delete(:object)
48
48
  end
49
-
49
+
50
50
  log = d.ob.get(:Log, d.data[:log_id]) #throws exception if it doesnt exist.
51
51
  end
52
-
52
+
53
53
  def object(ob_use)
54
54
  begin
55
55
  class_name = ob.get(:Log_data_value, self[:object_class_value_id])[:value].split("::").last
@@ -58,7 +58,7 @@ class Hayabusa::Models::Log_link < Knj::Datarow
58
58
  return false
59
59
  end
60
60
  end
61
-
61
+
62
62
  def object_class
63
63
  return ob.get(:Log_data_value, self[:object_class_value_id])[:value]
64
64
  end
@@ -1,11 +1,11 @@
1
- class Hayabusa::Models::Session < Knj::Datarow
1
+ class Hayabusa::Models::Session < Hayabusa::Datarow
2
2
  attr_reader :edata
3
3
  attr_accessor :sess_data
4
-
4
+
5
5
  def initialize(*args, &block)
6
6
  @edata = {}
7
7
  super(*args, &block)
8
-
8
+
9
9
  if self[:sess_data].to_s.length > 0
10
10
  begin
11
11
  @sess_data = Marshal.load(Base64.decode64(self[:sess_data]))
@@ -17,15 +17,15 @@ class Hayabusa::Models::Session < Knj::Datarow
17
17
  @sess_data = {}
18
18
  end
19
19
  end
20
-
20
+
21
21
  def self.add(d)
22
22
  d.data[:date_added] = Time.now if !d.data[:date_added]
23
23
  d.data[:date_lastused] = Time.now if !d.data[:date_lastused]
24
24
  end
25
-
25
+
26
26
  def flush
27
27
  flush_data = Base64.encode64(Marshal.dump(@sess_data))
28
-
28
+
29
29
  if self[:sess_data] != flush_data
30
30
  self.update(
31
31
  :sess_data => flush_data,
metadata CHANGED
@@ -1,41 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hayabusa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
- - Kasper Johansen
7
+ - Kasper Stöckel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: baza
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.38
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.38
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: knjrbfw
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - '='
31
+ - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: 0.0.110
33
+ version: 0.0.114
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - '='
38
+ - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: 0.0.110
40
+ version: 0.0.114
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: wref
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - '='
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
47
  version: 0.0.6
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - '='
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: 0.0.6
41
55
  - !ruby/object:Gem::Dependency
@@ -165,21 +179,63 @@ dependencies:
165
179
  - !ruby/object:Gem::Version
166
180
  version: 1.0.0
167
181
  - !ruby/object:Gem::Dependency
168
- name: jeweler
182
+ name: rmagick
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
- - - "~>"
185
+ - - ">="
172
186
  - !ruby/object:Gem::Version
173
- version: 1.8.8
187
+ version: '0'
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
- - - "~>"
192
+ - - ">="
179
193
  - !ruby/object:Gem::Version
180
- version: 1.8.8
194
+ version: '0'
181
195
  - !ruby/object:Gem::Dependency
182
- name: rmagick
196
+ name: rubocop
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rubocop-performance
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: rubocop-rake
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: rubocop-rspec
183
239
  requirement: !ruby/object:Gem::Requirement
184
240
  requirements:
185
241
  - - ">="
@@ -237,14 +293,9 @@ extra_rdoc_files:
237
293
  - LICENSE.txt
238
294
  - README.md
239
295
  files:
240
- - ".document"
241
- - ".rspec"
242
- - Gemfile
243
- - Gemfile.lock
244
296
  - LICENSE.txt
245
297
  - README.md
246
298
  - Rakefile
247
- - VERSION
248
299
  - bin/check_running.rb
249
300
  - bin/hayabusa_benchmark.rb
250
301
  - bin/hayabusa_cgi.rb
@@ -253,10 +304,6 @@ files:
253
304
  - bin/hayabusa_fcgi_server.rb
254
305
  - bin/hayabusa_spec_restart.rb
255
306
  - bin/knjappserver_start.rb
256
- - conf/apache2_cgi_rhtml_conf.conf
257
- - conf/apache2_fcgi_rhtml_conf.conf
258
- - conf/apache2_hayabusa_conf.conf
259
- - hayabusa.gemspec
260
307
  - lib/hayabusa.rb
261
308
  - lib/hayabusa_cgi.rb
262
309
  - lib/hayabusa_cgi_session.rb
@@ -264,6 +311,7 @@ files:
264
311
  - lib/hayabusa_client_session.rb
265
312
  - lib/hayabusa_custom_io.rb
266
313
  - lib/hayabusa_database.rb
314
+ - lib/hayabusa_datarow.rb
267
315
  - lib/hayabusa_erb_handler.rb
268
316
  - lib/hayabusa_ext/cleaner.rb
269
317
  - lib/hayabusa_ext/cmdline.rb
@@ -285,6 +333,8 @@ files:
285
333
  - lib/hayabusa_http_session_request.rb
286
334
  - lib/hayabusa_http_session_response.rb
287
335
  - lib/hayabusa_models.rb
336
+ - lib/hayabusa_objects.rb
337
+ - lib/hayabusa_revision.rb
288
338
  - lib/kernel_ext/gettext_methods.rb
289
339
  - lib/kernel_ext/magic_methods.rb
290
340
  - lib/models/log.rb
@@ -294,37 +344,6 @@ files:
294
344
  - lib/models/log_data_value.rb
295
345
  - lib/models/log_link.rb
296
346
  - lib/models/session.rb
297
- - pages/benchmark.rhtml
298
- - pages/benchmark_print.rhtml
299
- - pages/benchmark_simple.rhtml
300
- - pages/benchmark_threadded_content.rhtml
301
- - pages/config_cgi.rb
302
- - pages/config_fcgi.rb
303
- - pages/debug_database_connections.rhtml
304
- - pages/debug_http_sessions.rhtml
305
- - pages/debug_memory_usage.rhtml
306
- - pages/error_notfound.rhtml
307
- - pages/image.png
308
- - pages/logs_latest.rhtml
309
- - pages/logs_show.rhtml
310
- - pages/spec.rhtml
311
- - pages/spec_exit.rhtml
312
- - pages/spec_multiple_threads.rhtml
313
- - pages/spec_sleeper.rhtml
314
- - pages/spec_test_multiple_clients.rhtml
315
- - pages/spec_thread_joins.rhtml
316
- - pages/spec_threadded_content.rhtml
317
- - pages/spec_vars_get.rhtml
318
- - pages/spec_vars_header.rhtml
319
- - pages/spec_vars_post.rhtml
320
- - pages/spec_vars_post_fileupload.rhtml
321
- - pages/testpic.jpeg
322
- - pages/tests.rhtml
323
- - pages/threadded_content_test.rhtml
324
- - spec/fcgi_multiple_processes_spec.rb
325
- - spec/hayabusa_spec.rb
326
- - spec/spec_helper.rb
327
- - spec/test_upload.xlsx
328
347
  homepage: http://github.com/kaspernj/hayabusa
329
348
  licenses:
330
349
  - MIT
@@ -344,8 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
363
  - !ruby/object:Gem::Version
345
364
  version: '0'
346
365
  requirements: []
347
- rubyforge_project:
348
- rubygems_version: 2.2.2
366
+ rubygems_version: 3.2.32
349
367
  signing_key:
350
368
  specification_version: 4
351
369
  summary: A threadded web/app-server that supports stand-alone, CGI and FCGI-modes.
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/Gemfile DELETED
@@ -1,25 +0,0 @@
1
- source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
-
6
- gem "knjrbfw", "0.0.110"
7
- gem "wref", "0.0.6"
8
- gem "erubis"
9
- gem "mail"
10
- gem "datet"
11
- gem "http2"
12
- gem "tpool"
13
- gem "ruby_process"
14
-
15
- # Add dependencies to develop your gem here.
16
- # Include everything needed to run rake, tests, features, etc.
17
- group :development do
18
- gem "json"
19
- gem "rspec", ">= 2.3.0"
20
- gem "bundler", ">= 1.0.0"
21
- gem "jeweler", "~> 1.8.8"
22
- gem "rmagick"
23
- gem "sqlite3" if RUBY_ENGINE != "jruby"
24
- gem "php4r"
25
- end
data/Gemfile.lock DELETED
@@ -1,105 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- addressable (2.3.6)
5
- builder (3.2.2)
6
- datet (0.0.25)
7
- diff-lcs (1.2.4)
8
- erubis (2.7.0)
9
- faraday (0.8.9)
10
- multipart-post (~> 1.2.0)
11
- git (1.2.8)
12
- github_api (0.10.1)
13
- addressable
14
- faraday (~> 0.8.1)
15
- hashie (>= 1.2)
16
- multi_json (~> 1.4)
17
- nokogiri (~> 1.5.2)
18
- oauth2
19
- hashie (3.3.2)
20
- highline (1.6.21)
21
- http2 (0.0.22)
22
- jeweler (1.8.8)
23
- builder
24
- bundler (~> 1.0)
25
- git (>= 1.2.5)
26
- github_api (= 0.10.1)
27
- highline (>= 1.6.15)
28
- nokogiri (= 1.5.10)
29
- rake
30
- rdoc
31
- json (1.8.0)
32
- jwt (1.2.0)
33
- knjrbfw (0.0.110)
34
- datet
35
- http2
36
- php4r
37
- ruby_process
38
- tsafe
39
- wref
40
- mail (2.5.4)
41
- mime-types (~> 1.16)
42
- treetop (~> 1.4.8)
43
- mime-types (1.23)
44
- multi_json (1.10.1)
45
- multi_xml (0.5.5)
46
- multipart-post (1.2.0)
47
- nokogiri (1.5.10)
48
- oauth2 (1.0.0)
49
- faraday (>= 0.8, < 0.10)
50
- jwt (~> 1.0)
51
- multi_json (~> 1.3)
52
- multi_xml (~> 0.5)
53
- rack (~> 1.2)
54
- php4r (0.0.4)
55
- datet
56
- http2
57
- string-strtr
58
- polyglot (0.3.3)
59
- rack (1.5.2)
60
- rake (10.4.2)
61
- rdoc (4.1.2)
62
- json (~> 1.4)
63
- rmagick (2.13.2)
64
- rspec (2.13.0)
65
- rspec-core (~> 2.13.0)
66
- rspec-expectations (~> 2.13.0)
67
- rspec-mocks (~> 2.13.0)
68
- rspec-core (2.13.1)
69
- rspec-expectations (2.13.0)
70
- diff-lcs (>= 1.1.3, < 2.0)
71
- rspec-mocks (2.13.1)
72
- ruby_process (0.0.8)
73
- tsafe
74
- wref
75
- sqlite3 (1.3.7)
76
- string-strtr (0.0.3)
77
- tpool (0.0.4)
78
- treetop (1.4.14)
79
- polyglot
80
- polyglot (>= 0.3.1)
81
- tsafe (0.0.11)
82
- wref (0.0.6)
83
-
84
- PLATFORMS
85
- ruby
86
-
87
- DEPENDENCIES
88
- bundler (>= 1.0.0)
89
- datet
90
- erubis
91
- http2
92
- jeweler (~> 1.8.8)
93
- json
94
- knjrbfw (= 0.0.110)
95
- mail
96
- php4r
97
- rmagick
98
- rspec (>= 2.3.0)
99
- ruby_process
100
- sqlite3
101
- tpool
102
- wref (= 0.0.6)
103
-
104
- BUNDLED WITH
105
- 1.11.2
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.28
@@ -1,42 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- #This scripts start an appserver, executes a CGI-request for every FCGI-request and terminates when FCGI terminates.
4
- #Good for programming appserver-supported projects that doesnt need threadding without running an appserver all the time.
5
-
6
- error_log_file = "/tmp/hayabusa_fcgi.log"
7
-
8
- begin
9
- File.unlink(error_log_file) if File.exists?(error_log_file)
10
- rescue Errno::ENOENT
11
- #ignore.
12
- end
13
-
14
- begin
15
- require "rubygems"
16
- require "fcgi"
17
- require "fileutils"
18
-
19
- #Try to load development-version to enable debugging without doing constant gem-installations.
20
- begin
21
- require "#{File.realpath(File.dirname(__FILE__))}/../../knjrbfw/lib/knjrbfw.rb"
22
- rescue LoadError
23
- require "knjrbfw"
24
- end
25
-
26
- #Load 'Hayabusa' and start the FCGI-loop to begin handeling requests.
27
- require "#{File.dirname(Knj::Os.realpath(__FILE__))}/../lib/hayabusa.rb"
28
- fcgi = Hayabusa::Fcgi.new
29
- fcgi.fcgi_loop
30
- rescue Exception => e
31
- if !e.is_a?(Interrupt)
32
- #Log error to the log-file if something happened.
33
- File.open(error_log_file, "w") do |fp|
34
- fp.puts e.inspect
35
- fp.puts e.backtrace
36
- fp.puts ""
37
- end
38
- end
39
-
40
- #Just raise it normally as if a normal error occurred.
41
- raise e
42
- end
@@ -1,10 +0,0 @@
1
- Alias /hayabusa_cgi_test "/path/to/hayabusa/tests/cgi_test"
2
- ScriptAlias /hayabusa/ "/path/to/hayabusa/bin/"
3
-
4
- <Directory "/path/to/hayabusa/tests/cgi_test">
5
- Options +FollowSymLinks +ExecCGI
6
- RequestHeader set HAYABUSA_CGI_CONFIG "/path/to/hayabusa/tests/cgi_test/config_cgi.rb"
7
- AddHandler application/x-hayabusa-cgi .rhtml
8
- Action application/x-hayabusa-cgi /hayabusa/hayabusa_cgi.rb
9
- DirectoryIndex index.cgi
10
- </Directory>
@@ -1,22 +0,0 @@
1
- Alias /hayabusa_fcgi_test "/path/to/hayabusa/tests/fcgi_test"
2
- Alias /hayabusa_fcgi_bin "/path/to/hayabusa/bin"
3
-
4
- <IfModule mod_fcgid.c>
5
- SocketPath /tmp/fcgi_socket
6
- FcgidIdleTimeout 30
7
- FcgidMinProcessesPerClass 0
8
- FcgidIdleScanInterval 15
9
- </IfModule>
10
-
11
- <Directory "/path/to/hayabusa/tests/fcgi_test">
12
- RewriteEngine On
13
- RewriteRule ^(.*)\.rhtml$ /hayabusa_fcgi_bin/hayabusa_fcgi.fcgi
14
-
15
- Options +FollowSymLinks
16
-
17
- RequestHeader set HAYABUSA_FCGI_CONFIG "/path/to/hayabusa/tests/fcgi_test/config_fcgi.rb"
18
-
19
- AddHandler fcgid-script .fgci
20
-
21
- DirectoryIndex index.rhtml
22
- </Directory>
@@ -1,15 +0,0 @@
1
- <IfModule mod_fcgid.c>
2
- SocketPath /tmp/fcgi_socket
3
- FcgidIdleTimeout 30
4
- FcgidMinProcessesPerClass 0
5
- FcgidIdleScanInterval 15
6
- </IfModule>
7
-
8
- <Directory "/path/to/hayabusa/bin">
9
- Options +FollowSymLinks +ExecCGI
10
- Order allow,deny
11
- Allow from all
12
- AllowOverride none
13
- </Directory>
14
-
15
- Alias /hayabusa_fcgi_bin "/path/to/hayabusa/bin"