giga-smart-mod 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/giga-smart-mod.gemspec +12 -0
  3. data/thin-2.0.1/CHANGELOG +422 -0
  4. data/thin-2.0.1/README.md +88 -0
  5. data/thin-2.0.1/Rakefile +22 -0
  6. data/thin-2.0.1/bin/thin +6 -0
  7. data/thin-2.0.1/example/adapter.rb +32 -0
  8. data/thin-2.0.1/example/async_app.ru +126 -0
  9. data/thin-2.0.1/example/async_chat.ru +247 -0
  10. data/thin-2.0.1/example/async_tailer.ru +100 -0
  11. data/thin-2.0.1/example/config.ru +22 -0
  12. data/thin-2.0.1/example/monit_sockets +20 -0
  13. data/thin-2.0.1/example/monit_unixsock +20 -0
  14. data/thin-2.0.1/example/myapp.rb +1 -0
  15. data/thin-2.0.1/example/ramaze.ru +12 -0
  16. data/thin-2.0.1/example/thin.god +80 -0
  17. data/thin-2.0.1/example/thin_solaris_smf.erb +36 -0
  18. data/thin-2.0.1/example/thin_solaris_smf.readme.txt +150 -0
  19. data/thin-2.0.1/example/vlad.rake +72 -0
  20. data/thin-2.0.1/ext/thin_parser/common.rl +59 -0
  21. data/thin-2.0.1/ext/thin_parser/ext_help.h +14 -0
  22. data/thin-2.0.1/ext/thin_parser/extconf.rb +6 -0
  23. data/thin-2.0.1/ext/thin_parser/parser.c +1447 -0
  24. data/thin-2.0.1/ext/thin_parser/parser.h +49 -0
  25. data/thin-2.0.1/ext/thin_parser/parser.rl +152 -0
  26. data/thin-2.0.1/ext/thin_parser/thin.c +435 -0
  27. data/thin-2.0.1/lib/rack/adapter/loader.rb +82 -0
  28. data/thin-2.0.1/lib/rack/adapter/rails.rb +172 -0
  29. data/thin-2.0.1/lib/rack/handler/thin.rb +13 -0
  30. data/thin-2.0.1/lib/rackup/handler/thin.rb +13 -0
  31. data/thin-2.0.1/lib/thin/backends/base.rb +169 -0
  32. data/thin-2.0.1/lib/thin/backends/swiftiply_client.rb +66 -0
  33. data/thin-2.0.1/lib/thin/backends/tcp_server.rb +34 -0
  34. data/thin-2.0.1/lib/thin/backends/unix_server.rb +56 -0
  35. data/thin-2.0.1/lib/thin/command.rb +53 -0
  36. data/thin-2.0.1/lib/thin/connection.rb +219 -0
  37. data/thin-2.0.1/lib/thin/controllers/cluster.rb +178 -0
  38. data/thin-2.0.1/lib/thin/controllers/controller.rb +189 -0
  39. data/thin-2.0.1/lib/thin/controllers/service.rb +76 -0
  40. data/thin-2.0.1/lib/thin/controllers/service.sh.erb +39 -0
  41. data/thin-2.0.1/lib/thin/daemonizing.rb +199 -0
  42. data/thin-2.0.1/lib/thin/env.rb +35 -0
  43. data/thin-2.0.1/lib/thin/headers.rb +47 -0
  44. data/thin-2.0.1/lib/thin/logging.rb +174 -0
  45. data/thin-2.0.1/lib/thin/rackup/handler.rb +33 -0
  46. data/thin-2.0.1/lib/thin/request.rb +159 -0
  47. data/thin-2.0.1/lib/thin/response.rb +144 -0
  48. data/thin-2.0.1/lib/thin/runner.rb +238 -0
  49. data/thin-2.0.1/lib/thin/server.rb +290 -0
  50. data/thin-2.0.1/lib/thin/stats.html.erb +216 -0
  51. data/thin-2.0.1/lib/thin/stats.rb +52 -0
  52. data/thin-2.0.1/lib/thin/statuses.rb +48 -0
  53. data/thin-2.0.1/lib/thin/version.rb +19 -0
  54. data/thin-2.0.1/lib/thin.rb +45 -0
  55. metadata +94 -0
@@ -0,0 +1,216 @@
1
+ <%#
2
+ # Taken from Rack::ShowException
3
+ # adapted from Django <djangoproject.com>
4
+ # Copyright (c) 2005, the Lawrence Journal-World
5
+ # Used under the modified BSD license:
6
+ # http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
7
+ %>
8
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
9
+ <html lang="en">
10
+ <head>
11
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
12
+ <meta name="robots" content="NONE,NOARCHIVE" />
13
+ <title>Thin Stats</title>
14
+ <style type="text/css">
15
+ html * { padding:0; margin:0; }
16
+ body * { padding:10px 20px; }
17
+ body * * { padding:0; }
18
+ body { font:small sans-serif; }
19
+ body>div { border-bottom:1px solid #ddd; }
20
+ h1 { font-weight:normal; }
21
+ h2 { margin-bottom:.8em; }
22
+ h2 span { font-size:80%; color:#666; font-weight:normal; }
23
+ h3 { margin:1em 0 .5em 0; }
24
+ h4 { margin:0 0 .5em 0; font-weight: normal; }
25
+ table {
26
+ border:1px solid #ccc; border-collapse: collapse; background:white; }
27
+ tbody td, tbody th { vertical-align:top; padding:2px 3px; }
28
+ thead th {
29
+ padding:1px 6px 1px 3px; background:#fefefe; text-align:left;
30
+ font-weight:normal; font-size:11px; border:1px solid #ddd; }
31
+ tbody th { text-align:right; color:#666; padding-right:.5em; }
32
+ table.vars { margin:5px 0 2px 40px; }
33
+ table.vars td, table.req td { font-family:monospace; }
34
+ table td.code { width:100%;}
35
+ table td.code div { overflow:hidden; }
36
+ table.source th { color:#666; }
37
+ table.source td {
38
+ font-family:monospace; white-space:pre; border-bottom:1px solid #eee; }
39
+ ul.traceback { list-style-type:none; }
40
+ ul.traceback li.frame { margin-bottom:1em; }
41
+ div.context { margin: 10px 0; }
42
+ div.context ol {
43
+ padding-left:30px; margin:0 10px; list-style-position: inside; }
44
+ div.context ol li {
45
+ font-family:monospace; white-space:pre; color:#666; cursor:pointer; }
46
+ div.context ol.context-line li { color:black; background-color:#ccc; }
47
+ div.context ol.context-line li span { float: right; }
48
+ div.commands { margin-left: 40px; }
49
+ div.commands a { color:black; text-decoration:none; }
50
+ #summary { background: #ffc; }
51
+ #summary h2 { font-weight: normal; color: #666; }
52
+ #summary ul#quicklinks { list-style-type: none; margin-bottom: 2em; }
53
+ #summary ul#quicklinks li { float: left; padding: 0 1em; }
54
+ #summary ul#quicklinks>li+li { border-left: 1px #666 solid; }
55
+ #explanation { background:#eee; }
56
+ #template, #template-not-exist { background:#f6f6f6; }
57
+ #template-not-exist ul { margin: 0 0 0 20px; }
58
+ #traceback { background:#eee; }
59
+ #summary table { border:none; background:transparent; }
60
+ #requests { background:#f6f6f6; padding-left:120px; }
61
+ #requests h2, #requests h3 { position:relative; margin-left:-100px; }
62
+ #requests h3 { margin-bottom:-1em; }
63
+ .error { background: #ffc; }
64
+ .specific { color:#cc3300; font-weight:bold; }
65
+ </style>
66
+ </head>
67
+ <body>
68
+
69
+ <div id="summary">
70
+ <h1>Server stats</h1>
71
+ <h2><%= Thin::SERVER %></h2>
72
+ <table>
73
+ <tr>
74
+ <th>Uptime</th>
75
+ <td><%= Time.now - @start_time %> sec</td>
76
+ </tr>
77
+ <tr>
78
+ <th>PID</th>
79
+ <td><%=h Process.pid %></td>
80
+ </tr>
81
+ </table>
82
+
83
+ <% if @last_request %>
84
+ <h3>Jump to:</h3>
85
+ <ul id="quicklinks">
86
+ <li><a href="#get-info">GET</a></li>
87
+ <li><a href="#post-info">POST</a></li>
88
+ <li><a href="#cookie-info">Cookies</a></li>
89
+ <li><a href="#env-info">ENV</a></li>
90
+ </ul>
91
+ <% end %>
92
+ </div>
93
+
94
+ <div id="stats">
95
+ <h2>Requests</h2>
96
+ <h3>Stats</h3>
97
+ <table class="req">
98
+ <tr>
99
+ <td>Requests</td>
100
+ <td><%= @requests %></td>
101
+ </tr>
102
+ <tr>
103
+ <td>Finished</td>
104
+ <td><%= @requests_finished %></td>
105
+ </tr>
106
+ <tr>
107
+ <td>Errors</td>
108
+ <td><%= @requests - @requests_finished %></td>
109
+ </tr>
110
+ <tr>
111
+ <td>Last request</td>
112
+ <td><%= @last_request_time %> sec</td>
113
+ </tr>
114
+ </table>
115
+ </div>
116
+
117
+ <% if @last_request %>
118
+ <div id="requestinfo">
119
+ <h2>Last Request information</h2>
120
+
121
+ <h3 id="get-info">GET</h3>
122
+ <% unless @last_request.GET.empty? %>
123
+ <table class="req">
124
+ <thead>
125
+ <tr>
126
+ <th>Variable</th>
127
+ <th>Value</th>
128
+ </tr>
129
+ </thead>
130
+ <tbody>
131
+ <% @last_request.GET.sort_by { |k, v| k.to_s }.each { |key, val| %>
132
+ <tr>
133
+ <td><%=h key %></td>
134
+ <td class="code"><div><%=h val.inspect %></div></td>
135
+ </tr>
136
+ <% } %>
137
+ </tbody>
138
+ </table>
139
+ <% else %>
140
+ <p>No GET data.</p>
141
+ <% end %>
142
+
143
+ <h3 id="post-info">POST</h3>
144
+ <% unless @last_request.POST.empty? %>
145
+ <table class="req">
146
+ <thead>
147
+ <tr>
148
+ <th>Variable</th>
149
+ <th>Value</th>
150
+ </tr>
151
+ </thead>
152
+ <tbody>
153
+ <% @last_request.POST.sort_by { |k, v| k.to_s }.each { |key, val| %>
154
+ <tr>
155
+ <td><%=h key %></td>
156
+ <td class="code"><div><%=h val.inspect %></div></td>
157
+ </tr>
158
+ <% } %>
159
+ </tbody>
160
+ </table>
161
+ <% else %>
162
+ <p>No POST data.</p>
163
+ <% end %>
164
+
165
+
166
+ <h3 id="cookie-info">COOKIES</h3>
167
+ <% unless @last_request.cookies.empty? %>
168
+ <table class="req">
169
+ <thead>
170
+ <tr>
171
+ <th>Variable</th>
172
+ <th>Value</th>
173
+ </tr>
174
+ </thead>
175
+ <tbody>
176
+ <% @last_request.cookies.each { |key, val| %>
177
+ <tr>
178
+ <td><%=h key %></td>
179
+ <td class="code"><div><%=h val.inspect %></div></td>
180
+ </tr>
181
+ <% } %>
182
+ </tbody>
183
+ </table>
184
+ <% else %>
185
+ <p>No cookie data.</p>
186
+ <% end %>
187
+
188
+ <h3 id="env-info">Rack ENV</h3>
189
+ <table class="req">
190
+ <thead>
191
+ <tr>
192
+ <th>Variable</th>
193
+ <th>Value</th>
194
+ </tr>
195
+ </thead>
196
+ <tbody>
197
+ <% @last_request.env.sort_by { |k, v| k.to_s }.each { |key, val| %>
198
+ <tr>
199
+ <td><%=h key %></td>
200
+ <td class="code"><div><%=h val %></div></td>
201
+ </tr>
202
+ <% } %>
203
+ </tbody>
204
+ </table>
205
+
206
+ </div>
207
+ <% end %>
208
+
209
+ <div id="explanation">
210
+ <p>
211
+ You're seeing this page because you use <code>Thin::Stats</code>.
212
+ </p>
213
+ </div>
214
+
215
+ </body>
216
+ </html>
@@ -0,0 +1,52 @@
1
+ require 'erb'
2
+
3
+ module Thin
4
+ module Stats
5
+ # Rack adapter to log stats about a Rack application.
6
+ class Adapter
7
+ include ERB::Util
8
+
9
+ def initialize(app, path='/stats')
10
+ @app = app
11
+ @path = path
12
+
13
+ @template = ERB.new(File.read(File.dirname(__FILE__) + '/stats.html.erb'))
14
+
15
+ @requests = 0
16
+ @requests_finished = 0
17
+ @start_time = Time.now
18
+ end
19
+
20
+ def call(env)
21
+ if env['PATH_INFO'].index(@path) == 0
22
+ serve(env)
23
+ else
24
+ log(env) { @app.call(env) }
25
+ end
26
+ end
27
+
28
+ def log(env)
29
+ @requests += 1
30
+ @last_request = Rack::Request.new(env)
31
+ request_started_at = Time.now
32
+
33
+ response = yield
34
+
35
+ @requests_finished += 1
36
+ @last_request_time = Time.now - request_started_at
37
+
38
+ response
39
+ end
40
+
41
+ def serve(env)
42
+ body = @template.result(binding)
43
+
44
+ [
45
+ 200,
46
+ { 'content-type' => 'text/html' },
47
+ [body]
48
+ ]
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,48 @@
1
+ module Thin
2
+ # Every standard HTTP code mapped to the appropriate message.
3
+ # Stolent from Mongrel.
4
+ HTTP_STATUS_CODES = {
5
+ 100 => 'Continue',
6
+ 101 => 'Switching Protocols',
7
+ 200 => 'OK',
8
+ 201 => 'Created',
9
+ 202 => 'Accepted',
10
+ 203 => 'Non-Authoritative Information',
11
+ 204 => 'No Content',
12
+ 205 => 'Reset Content',
13
+ 206 => 'Partial Content',
14
+ 300 => 'Multiple Choices',
15
+ 301 => 'Moved Permanently',
16
+ 302 => 'Moved Temporarily',
17
+ 303 => 'See Other',
18
+ 304 => 'Not Modified',
19
+ 305 => 'Use Proxy',
20
+ 400 => 'Bad Request',
21
+ 401 => 'Unauthorized',
22
+ 402 => 'Payment Required',
23
+ 403 => 'Forbidden',
24
+ 404 => 'Not Found',
25
+ 405 => 'Method Not Allowed',
26
+ 406 => 'Not Acceptable',
27
+ 407 => 'Proxy Authentication Required',
28
+ 408 => 'Request Time-out',
29
+ 409 => 'Conflict',
30
+ 410 => 'Gone',
31
+ 411 => 'Length Required',
32
+ 412 => 'Precondition Failed',
33
+ 413 => 'Request Entity Too Large',
34
+ 414 => 'Request-URI Too Large',
35
+ 415 => 'Unsupported Media Type',
36
+ 422 => 'Unprocessable Entity',
37
+ 428 => 'Precondition Required',
38
+ 429 => 'Too Many Requests',
39
+ 431 => 'Request Header Fields Too Large',
40
+ 500 => 'Internal Server Error',
41
+ 501 => 'Not Implemented',
42
+ 502 => 'Bad Gateway',
43
+ 503 => 'Service Unavailable',
44
+ 504 => 'Gateway Time-out',
45
+ 505 => 'HTTP Version not supported',
46
+ 511 => 'Network Authentication Required'
47
+ }
48
+ end
@@ -0,0 +1,19 @@
1
+ module Thin
2
+ # Raised when a feature is not supported on the
3
+ # current platform.
4
+ class PlatformNotSupported < RuntimeError; end
5
+
6
+ VERSION = "2.0.1"
7
+ CODENAME = "Thinception".freeze
8
+
9
+ NAME = 'thin'.freeze
10
+ SERVER = "#{NAME} #{VERSION} codename #{CODENAME}".freeze
11
+
12
+ def self.win?
13
+ RUBY_PLATFORM =~ /mswin|mingw/
14
+ end
15
+
16
+ def self.linux?
17
+ RUBY_PLATFORM =~ /linux/
18
+ end
19
+ end
@@ -0,0 +1,45 @@
1
+ require 'fileutils'
2
+ require 'timeout'
3
+ require 'stringio'
4
+ require 'time'
5
+ require 'forwardable'
6
+ require 'openssl'
7
+ require 'eventmachine'
8
+ require 'rack'
9
+
10
+ module Thin
11
+ autoload :Command, "thin/command"
12
+ autoload :Connection, "thin/connection"
13
+ autoload :Daemonizable, "thin/daemonizing"
14
+ autoload :Logging, "thin/logging"
15
+ autoload :Headers, "thin/headers"
16
+ autoload :Request, "thin/request"
17
+ autoload :Response, "thin/response"
18
+ autoload :Runner, "thin/runner"
19
+ autoload :Server, "thin/server"
20
+ autoload :Stats, "thin/stats"
21
+
22
+ module Backends
23
+ autoload :Base, "thin/backends/base"
24
+ autoload :SwiftiplyClient, "thin/backends/swiftiply_client"
25
+ autoload :TcpServer, "thin/backends/tcp_server"
26
+ autoload :UnixServer, "thin/backends/unix_server"
27
+ end
28
+
29
+ module Controllers
30
+ autoload :Cluster, "thin/controllers/cluster"
31
+ autoload :Controller, "thin/controllers/controller"
32
+ autoload :Service, "thin/controllers/service"
33
+ end
34
+ end
35
+
36
+ require "thin/version"
37
+ require "thin/statuses"
38
+ require "rack/adapter/loader"
39
+ require "thin_parser"
40
+
41
+ module Rack
42
+ module Adapter
43
+ autoload :Rails, "rack/adapter/rails"
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: giga-smart-mod
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrey78
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2026-07-06 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: University research based on thin
13
+ email:
14
+ - cakoc614@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - giga-smart-mod.gemspec
20
+ - thin-2.0.1/CHANGELOG
21
+ - thin-2.0.1/README.md
22
+ - thin-2.0.1/Rakefile
23
+ - thin-2.0.1/bin/thin
24
+ - thin-2.0.1/example/adapter.rb
25
+ - thin-2.0.1/example/async_app.ru
26
+ - thin-2.0.1/example/async_chat.ru
27
+ - thin-2.0.1/example/async_tailer.ru
28
+ - thin-2.0.1/example/config.ru
29
+ - thin-2.0.1/example/monit_sockets
30
+ - thin-2.0.1/example/monit_unixsock
31
+ - thin-2.0.1/example/myapp.rb
32
+ - thin-2.0.1/example/ramaze.ru
33
+ - thin-2.0.1/example/thin.god
34
+ - thin-2.0.1/example/thin_solaris_smf.erb
35
+ - thin-2.0.1/example/thin_solaris_smf.readme.txt
36
+ - thin-2.0.1/example/vlad.rake
37
+ - thin-2.0.1/ext/thin_parser/common.rl
38
+ - thin-2.0.1/ext/thin_parser/ext_help.h
39
+ - thin-2.0.1/ext/thin_parser/extconf.rb
40
+ - thin-2.0.1/ext/thin_parser/parser.c
41
+ - thin-2.0.1/ext/thin_parser/parser.h
42
+ - thin-2.0.1/ext/thin_parser/parser.rl
43
+ - thin-2.0.1/ext/thin_parser/thin.c
44
+ - thin-2.0.1/lib/rack/adapter/loader.rb
45
+ - thin-2.0.1/lib/rack/adapter/rails.rb
46
+ - thin-2.0.1/lib/rack/handler/thin.rb
47
+ - thin-2.0.1/lib/rackup/handler/thin.rb
48
+ - thin-2.0.1/lib/thin.rb
49
+ - thin-2.0.1/lib/thin/backends/base.rb
50
+ - thin-2.0.1/lib/thin/backends/swiftiply_client.rb
51
+ - thin-2.0.1/lib/thin/backends/tcp_server.rb
52
+ - thin-2.0.1/lib/thin/backends/unix_server.rb
53
+ - thin-2.0.1/lib/thin/command.rb
54
+ - thin-2.0.1/lib/thin/connection.rb
55
+ - thin-2.0.1/lib/thin/controllers/cluster.rb
56
+ - thin-2.0.1/lib/thin/controllers/controller.rb
57
+ - thin-2.0.1/lib/thin/controllers/service.rb
58
+ - thin-2.0.1/lib/thin/controllers/service.sh.erb
59
+ - thin-2.0.1/lib/thin/daemonizing.rb
60
+ - thin-2.0.1/lib/thin/env.rb
61
+ - thin-2.0.1/lib/thin/headers.rb
62
+ - thin-2.0.1/lib/thin/logging.rb
63
+ - thin-2.0.1/lib/thin/rackup/handler.rb
64
+ - thin-2.0.1/lib/thin/request.rb
65
+ - thin-2.0.1/lib/thin/response.rb
66
+ - thin-2.0.1/lib/thin/runner.rb
67
+ - thin-2.0.1/lib/thin/server.rb
68
+ - thin-2.0.1/lib/thin/stats.html.erb
69
+ - thin-2.0.1/lib/thin/stats.rb
70
+ - thin-2.0.1/lib/thin/statuses.rb
71
+ - thin-2.0.1/lib/thin/version.rb
72
+ homepage: https://rubygems.org/profiles/Andrey78
73
+ licenses:
74
+ - MIT
75
+ metadata:
76
+ source_code_uri: https://github.com/Andrey78/giga-smart-mod
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubygems_version: 3.6.2
92
+ specification_version: 4
93
+ summary: Research test
94
+ test_files: []