puma 3.8.2 → 4.3.12

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

Potentially problematic release.


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

Files changed (91) hide show
  1. checksums.yaml +5 -5
  2. data/History.md +305 -0
  3. data/LICENSE +0 -0
  4. data/README.md +162 -224
  5. data/bin/puma-wild +0 -0
  6. data/docs/architecture.md +37 -0
  7. data/{DEPLOYMENT.md → docs/deployment.md} +24 -4
  8. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  9. data/docs/images/puma-connection-flow.png +0 -0
  10. data/docs/images/puma-general-arch.png +0 -0
  11. data/docs/nginx.md +0 -0
  12. data/docs/plugins.md +38 -0
  13. data/docs/restart.md +41 -0
  14. data/docs/signals.md +56 -3
  15. data/docs/systemd.md +130 -37
  16. data/docs/tcp_mode.md +96 -0
  17. data/ext/puma_http11/PumaHttp11Service.java +2 -0
  18. data/ext/puma_http11/ext_help.h +0 -0
  19. data/ext/puma_http11/extconf.rb +21 -0
  20. data/ext/puma_http11/http11_parser.c +134 -144
  21. data/ext/puma_http11/http11_parser.h +0 -0
  22. data/ext/puma_http11/http11_parser.java.rl +21 -37
  23. data/ext/puma_http11/http11_parser.rl +12 -10
  24. data/ext/puma_http11/http11_parser_common.rl +4 -4
  25. data/ext/puma_http11/io_buffer.c +0 -0
  26. data/ext/puma_http11/mini_ssl.c +165 -34
  27. data/ext/puma_http11/org/jruby/puma/Http11.java +106 -114
  28. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +85 -101
  29. data/ext/puma_http11/org/jruby/puma/IOBuffer.java +72 -0
  30. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +30 -6
  31. data/ext/puma_http11/puma_http11.c +3 -0
  32. data/lib/puma/accept_nonblock.rb +7 -1
  33. data/lib/puma/app/status.rb +42 -26
  34. data/lib/puma/binder.rb +57 -74
  35. data/lib/puma/cli.rb +26 -7
  36. data/lib/puma/client.rb +307 -191
  37. data/lib/puma/cluster.rb +78 -34
  38. data/lib/puma/commonlogger.rb +2 -0
  39. data/lib/puma/configuration.rb +24 -16
  40. data/lib/puma/const.rb +41 -20
  41. data/lib/puma/control_cli.rb +46 -19
  42. data/lib/puma/detect.rb +2 -0
  43. data/lib/puma/dsl.rb +329 -68
  44. data/lib/puma/events.rb +6 -2
  45. data/lib/puma/io_buffer.rb +3 -6
  46. data/lib/puma/jruby_restart.rb +2 -1
  47. data/lib/puma/launcher.rb +125 -61
  48. data/lib/puma/minissl/context_builder.rb +76 -0
  49. data/lib/puma/minissl.rb +85 -28
  50. data/lib/puma/null_io.rb +2 -0
  51. data/lib/puma/plugin/tmp_restart.rb +2 -1
  52. data/lib/puma/plugin.rb +7 -2
  53. data/lib/puma/rack/builder.rb +4 -1
  54. data/lib/puma/rack/urlmap.rb +2 -0
  55. data/lib/puma/rack_default.rb +2 -0
  56. data/lib/puma/reactor.rb +224 -34
  57. data/lib/puma/runner.rb +27 -6
  58. data/lib/puma/server.rb +212 -68
  59. data/lib/puma/single.rb +16 -5
  60. data/lib/puma/state_file.rb +2 -0
  61. data/lib/puma/tcp_logger.rb +2 -0
  62. data/lib/puma/thread_pool.rb +67 -36
  63. data/lib/puma/util.rb +2 -6
  64. data/lib/puma.rb +16 -0
  65. data/lib/rack/handler/puma.rb +16 -5
  66. data/tools/docker/Dockerfile +16 -0
  67. data/tools/jungle/README.md +12 -2
  68. data/tools/jungle/init.d/README.md +2 -0
  69. data/tools/jungle/init.d/puma +8 -8
  70. data/tools/jungle/init.d/run-puma +1 -1
  71. data/tools/jungle/rc.d/README.md +74 -0
  72. data/tools/jungle/rc.d/puma +61 -0
  73. data/tools/jungle/rc.d/puma.conf +10 -0
  74. data/tools/jungle/upstart/README.md +0 -0
  75. data/tools/jungle/upstart/puma-manager.conf +0 -0
  76. data/tools/jungle/upstart/puma.conf +0 -0
  77. data/tools/trickletest.rb +1 -2
  78. metadata +32 -93
  79. data/.github/issue_template.md +0 -20
  80. data/Gemfile +0 -12
  81. data/Manifest.txt +0 -78
  82. data/Rakefile +0 -158
  83. data/Release.md +0 -9
  84. data/gemfiles/2.1-Gemfile +0 -12
  85. data/lib/puma/compat.rb +0 -14
  86. data/lib/puma/convenient.rb +0 -23
  87. data/lib/puma/daemon_ext.rb +0 -31
  88. data/lib/puma/delegation.rb +0 -11
  89. data/lib/puma/java_io_buffer.rb +0 -45
  90. data/lib/puma/rack/backports/uri/common_193.rb +0 -33
  91. data/puma.gemspec +0 -52
metadata CHANGED
@@ -1,81 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.2
4
+ version: 4.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rdoc
14
+ name: nio4r
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
20
- type: :development
19
+ version: '2.0'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
27
- - !ruby/object:Gem::Dependency
28
- name: rack
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '1.1'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '3.0'
37
- type: :development
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '1.1'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '3.0'
47
- - !ruby/object:Gem::Dependency
48
- name: rake-compiler
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '0.8'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '0.8'
61
- - !ruby/object:Gem::Dependency
62
- name: hoe
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '3.14'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '3.14'
26
+ version: '2.0'
75
27
  description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server
76
28
  for Ruby/Rack applications. Puma is intended for use in both development and production
77
- environments. In order to get the best throughput, it is highly recommended that
78
- you use a Ruby implementation with real threads like Rubinius or JRuby.
29
+ environments. It's great for highly concurrent Ruby implementations such as Rubinius
30
+ and JRuby as well as as providing process worker support to support CRuby well.
79
31
  email:
80
32
  - evan@phx.io
81
33
  executables:
@@ -83,35 +35,25 @@ executables:
83
35
  - pumactl
84
36
  extensions:
85
37
  - ext/puma_http11/extconf.rb
86
- extra_rdoc_files:
87
- - ".github/issue_template.md"
88
- - DEPLOYMENT.md
89
- - History.md
90
- - Manifest.txt
91
- - README.md
92
- - Release.md
93
- - docs/nginx.md
94
- - docs/signals.md
95
- - docs/systemd.md
96
- - tools/jungle/README.md
97
- - tools/jungle/init.d/README.md
98
- - tools/jungle/upstart/README.md
38
+ extra_rdoc_files: []
99
39
  files:
100
- - ".github/issue_template.md"
101
- - DEPLOYMENT.md
102
- - Gemfile
103
40
  - History.md
104
41
  - LICENSE
105
- - Manifest.txt
106
42
  - README.md
107
- - Rakefile
108
- - Release.md
109
43
  - bin/puma
110
44
  - bin/puma-wild
111
45
  - bin/pumactl
46
+ - docs/architecture.md
47
+ - docs/deployment.md
48
+ - docs/images/puma-connection-flow-no-reactor.png
49
+ - docs/images/puma-connection-flow.png
50
+ - docs/images/puma-general-arch.png
112
51
  - docs/nginx.md
52
+ - docs/plugins.md
53
+ - docs/restart.md
113
54
  - docs/signals.md
114
55
  - docs/systemd.md
56
+ - docs/tcp_mode.md
115
57
  - ext/puma_http11/PumaHttp11Service.java
116
58
  - ext/puma_http11/ext_help.h
117
59
  - ext/puma_http11/extconf.rb
@@ -124,9 +66,9 @@ files:
124
66
  - ext/puma_http11/mini_ssl.c
125
67
  - ext/puma_http11/org/jruby/puma/Http11.java
126
68
  - ext/puma_http11/org/jruby/puma/Http11Parser.java
69
+ - ext/puma_http11/org/jruby/puma/IOBuffer.java
127
70
  - ext/puma_http11/org/jruby/puma/MiniSSL.java
128
71
  - ext/puma_http11/puma_http11.c
129
- - gemfiles/2.1-Gemfile
130
72
  - lib/puma.rb
131
73
  - lib/puma/accept_nonblock.rb
132
74
  - lib/puma/app/status.rb
@@ -135,25 +77,20 @@ files:
135
77
  - lib/puma/client.rb
136
78
  - lib/puma/cluster.rb
137
79
  - lib/puma/commonlogger.rb
138
- - lib/puma/compat.rb
139
80
  - lib/puma/configuration.rb
140
81
  - lib/puma/const.rb
141
82
  - lib/puma/control_cli.rb
142
- - lib/puma/convenient.rb
143
- - lib/puma/daemon_ext.rb
144
- - lib/puma/delegation.rb
145
83
  - lib/puma/detect.rb
146
84
  - lib/puma/dsl.rb
147
85
  - lib/puma/events.rb
148
86
  - lib/puma/io_buffer.rb
149
- - lib/puma/java_io_buffer.rb
150
87
  - lib/puma/jruby_restart.rb
151
88
  - lib/puma/launcher.rb
152
89
  - lib/puma/minissl.rb
90
+ - lib/puma/minissl/context_builder.rb
153
91
  - lib/puma/null_io.rb
154
92
  - lib/puma/plugin.rb
155
93
  - lib/puma/plugin/tmp_restart.rb
156
- - lib/puma/rack/backports/uri/common_193.rb
157
94
  - lib/puma/rack/builder.rb
158
95
  - lib/puma/rack/urlmap.rb
159
96
  - lib/puma/rack_default.rb
@@ -166,11 +103,14 @@ files:
166
103
  - lib/puma/thread_pool.rb
167
104
  - lib/puma/util.rb
168
105
  - lib/rack/handler/puma.rb
169
- - puma.gemspec
106
+ - tools/docker/Dockerfile
170
107
  - tools/jungle/README.md
171
108
  - tools/jungle/init.d/README.md
172
109
  - tools/jungle/init.d/puma
173
110
  - tools/jungle/init.d/run-puma
111
+ - tools/jungle/rc.d/README.md
112
+ - tools/jungle/rc.d/puma
113
+ - tools/jungle/rc.d/puma.conf
174
114
  - tools/jungle/upstart/README.md
175
115
  - tools/jungle/upstart/puma-manager.conf
176
116
  - tools/jungle/upstart/puma.conf
@@ -178,27 +118,26 @@ files:
178
118
  homepage: http://puma.io
179
119
  licenses:
180
120
  - BSD-3-Clause
181
- metadata: {}
182
- post_install_message:
183
- rdoc_options:
184
- - "--main"
185
- - README.md
121
+ metadata:
122
+ msys2_mingw_dependencies: openssl
123
+ changelog_uri: https://github.com/puma/puma/blob/master/History.md
124
+ post_install_message:
125
+ rdoc_options: []
186
126
  require_paths:
187
127
  - lib
188
128
  required_ruby_version: !ruby/object:Gem::Requirement
189
129
  requirements:
190
130
  - - ">="
191
131
  - !ruby/object:Gem::Version
192
- version: 1.9.3
132
+ version: '2.2'
193
133
  required_rubygems_version: !ruby/object:Gem::Requirement
194
134
  requirements:
195
135
  - - ">="
196
136
  - !ruby/object:Gem::Version
197
137
  version: '0'
198
138
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.5.1
201
- signing_key:
139
+ rubygems_version: 3.2.26
140
+ signing_key:
202
141
  specification_version: 4
203
142
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for
204
143
  Ruby/Rack applications
@@ -1,20 +0,0 @@
1
- ### Steps to reproduce
2
-
3
- 1) ...
4
-
5
- 2) ...
6
-
7
- 3) ...
8
-
9
- ### Expected behavior
10
-
11
- Tell us what should happen ...
12
-
13
- ### Actual behavior
14
-
15
- Tell us what happens instead ...
16
-
17
- ### System configuration
18
-
19
- **Ruby version**:
20
- **Rails version**:
data/Gemfile DELETED
@@ -1,12 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "hoe"
4
- gem "hoe-git"
5
- gem "hoe-ignore"
6
- gem "rdoc"
7
- gem "rake-compiler"
8
-
9
- gem "rack", "< 3.0"
10
- gem "minitest", "~> 5.9"
11
-
12
- gem "jruby-openssl", :platform => "jruby"
data/Manifest.txt DELETED
@@ -1,78 +0,0 @@
1
- .github/issue_template.md
2
- DEPLOYMENT.md
3
- Gemfile
4
- History.md
5
- LICENSE
6
- Manifest.txt
7
- README.md
8
- Rakefile
9
- Release.md
10
- bin/puma
11
- bin/puma-wild
12
- bin/pumactl
13
- docs/nginx.md
14
- docs/signals.md
15
- docs/systemd.md
16
- ext/puma_http11/PumaHttp11Service.java
17
- ext/puma_http11/ext_help.h
18
- ext/puma_http11/extconf.rb
19
- ext/puma_http11/http11_parser.c
20
- ext/puma_http11/http11_parser.h
21
- ext/puma_http11/http11_parser.java.rl
22
- ext/puma_http11/http11_parser.rl
23
- ext/puma_http11/http11_parser_common.rl
24
- ext/puma_http11/io_buffer.c
25
- ext/puma_http11/mini_ssl.c
26
- ext/puma_http11/org/jruby/puma/Http11.java
27
- ext/puma_http11/org/jruby/puma/Http11Parser.java
28
- ext/puma_http11/org/jruby/puma/MiniSSL.java
29
- ext/puma_http11/puma_http11.c
30
- gemfiles/2.1-Gemfile
31
- lib/puma.rb
32
- lib/puma/accept_nonblock.rb
33
- lib/puma/app/status.rb
34
- lib/puma/binder.rb
35
- lib/puma/cli.rb
36
- lib/puma/client.rb
37
- lib/puma/cluster.rb
38
- lib/puma/commonlogger.rb
39
- lib/puma/compat.rb
40
- lib/puma/configuration.rb
41
- lib/puma/const.rb
42
- lib/puma/control_cli.rb
43
- lib/puma/convenient.rb
44
- lib/puma/daemon_ext.rb
45
- lib/puma/delegation.rb
46
- lib/puma/detect.rb
47
- lib/puma/dsl.rb
48
- lib/puma/events.rb
49
- lib/puma/io_buffer.rb
50
- lib/puma/java_io_buffer.rb
51
- lib/puma/jruby_restart.rb
52
- lib/puma/launcher.rb
53
- lib/puma/minissl.rb
54
- lib/puma/null_io.rb
55
- lib/puma/plugin.rb
56
- lib/puma/plugin/tmp_restart.rb
57
- lib/puma/rack/backports/uri/common_193.rb
58
- lib/puma/rack/builder.rb
59
- lib/puma/rack/urlmap.rb
60
- lib/puma/rack_default.rb
61
- lib/puma/reactor.rb
62
- lib/puma/runner.rb
63
- lib/puma/server.rb
64
- lib/puma/single.rb
65
- lib/puma/state_file.rb
66
- lib/puma/tcp_logger.rb
67
- lib/puma/thread_pool.rb
68
- lib/puma/util.rb
69
- lib/rack/handler/puma.rb
70
- puma.gemspec
71
- tools/jungle/README.md
72
- tools/jungle/init.d/README.md
73
- tools/jungle/init.d/puma
74
- tools/jungle/init.d/run-puma
75
- tools/jungle/upstart/README.md
76
- tools/jungle/upstart/puma-manager.conf
77
- tools/jungle/upstart/puma.conf
78
- tools/trickletest.rb
data/Rakefile DELETED
@@ -1,158 +0,0 @@
1
- require "bundler/setup"
2
- require "hoe"
3
- require "rake/extensiontask"
4
- require "rake/javaextensiontask"
5
-
6
- IS_JRUBY = defined?(RUBY_ENGINE) ? RUBY_ENGINE == "jruby" : false
7
-
8
- Hoe.plugin :git
9
- Hoe.plugin :ignore
10
-
11
- HOE = Hoe.spec "puma" do
12
- self.readme_file = "README.md"
13
- self.urls = %w!http://puma.io https://github.com/puma/puma!
14
-
15
- license "BSD-3-Clause"
16
- developer 'Evan Phoenix', 'evan@phx.io'
17
-
18
- spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
19
- spec_extras[:executables] = ['puma', 'pumactl']
20
- spec_extras[:homepage] = self.urls.first
21
-
22
- require_ruby_version ">= 1.9.3"
23
-
24
- dependency "rack", [">= 1.1", "< 3.0"], :development
25
-
26
- extra_dev_deps << ["rake-compiler", "~> 0.8"]
27
- end
28
-
29
- task :prerelease => [:clobber, :check_manifest, :test]
30
-
31
- # hoe/test and rake-compiler don't seem to play well together, so disable
32
- # hoe/test's .gemtest touch file thingy for now
33
- HOE.spec.files -= [".gemtest"]
34
-
35
- include Hoe::Git
36
-
37
- desc "Print the current changelog."
38
- task "changelog" do
39
- tag = ENV["FROM"] || git_tags.last
40
- range = [tag, "HEAD"].compact.join ".."
41
- cmd = "git log #{range} '--format=tformat:%B|||%aN|||%aE|||'"
42
- now = Time.new.strftime "%Y-%m-%d"
43
-
44
- changes = `#{cmd}`.split(/\|\|\|/).each_slice(3).map { |msg, author, email|
45
- msg.split(/\n/).reject { |s| s.empty? }.first
46
- }.flatten.compact
47
-
48
- $changes = Hash.new { |h,k| h[k] = [] }
49
-
50
- codes = {
51
- "!" => :major,
52
- "+" => :minor,
53
- "*" => :minor,
54
- "-" => :bug,
55
- "?" => :unknown,
56
- }
57
-
58
- codes_re = Regexp.escape codes.keys.join
59
-
60
- changes.each do |change|
61
- if change =~ /^\s*([#{codes_re}])\s*(.*)/ then
62
- code, line = codes[$1], $2
63
- else
64
- code, line = codes["?"], change.chomp
65
- end
66
-
67
- $changes[code] << line
68
- end
69
-
70
- puts "## #{ENV['VERSION'] || 'NEXT'} / #{now}"
71
- puts
72
- changelog_section :major
73
- changelog_section :minor
74
- changelog_section :bug
75
- changelog_section :unknown
76
- puts
77
- end
78
-
79
- # generate extension code using Ragel (C and Java)
80
- desc "Generate extension code (C and Java) using Ragel"
81
- task :ragel
82
-
83
- file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
84
- begin
85
- sh "ragel #{t.prerequisites.last} -C -G2 -I ext/puma_http11 -o #{t.name}"
86
- rescue
87
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
88
- end
89
- end
90
- task :ragel => ['ext/puma_http11/http11_parser.c']
91
-
92
- file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
93
- begin
94
- sh "ragel #{t.prerequisites.last} -J -G2 -I ext/puma_http11 -o #{t.name}"
95
- rescue
96
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
97
- end
98
- end
99
- task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java']
100
-
101
- if !IS_JRUBY
102
-
103
- # compile extensions using rake-compiler
104
- # C (MRI, Rubinius)
105
- Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext|
106
- # place extension inside namespace
107
- ext.lib_dir = "lib/puma"
108
-
109
- ext.cross_compile = true
110
- ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']
111
- ext.cross_compiling do |spec|
112
- # add fat-binary stub only when cross compiling
113
- spec.files << "lib/puma/puma_http11.rb"
114
- end
115
-
116
- CLEAN.include "lib/puma/{1.8,1.9}"
117
- CLEAN.include "lib/puma/puma_http11.rb"
118
- end
119
-
120
- else
121
-
122
- # Java (JRuby)
123
- Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext|
124
- ext.lib_dir = "lib/puma"
125
- end
126
-
127
- end
128
-
129
- # the following is a fat-binary stub that will be used when
130
- # require 'puma/puma_http11' and will use either 1.8 or 1.9 version depending
131
- # on RUBY_VERSION
132
- file "lib/puma/puma_http11.rb" do |t|
133
- File.open(t.name, "w") do |f|
134
- f.puts "RUBY_VERSION =~ /(\d+.\d+)/"
135
- f.puts 'require "puma/#{$1}/puma_http11"'
136
- end
137
- end
138
-
139
- # tests require extension be compiled, but depend on the platform
140
- if IS_JRUBY
141
- task :test => [:java]
142
- else
143
- task :test => [:compile]
144
- end
145
-
146
- namespace :test do
147
- desc "Run the integration tests"
148
- task :integration do
149
- sh "cd test/shell; sh run.sh"
150
- end
151
-
152
- desc "Run all tests"
153
- if defined?(JRUBY_VERSION) and ENV['TRAVIS']
154
- task :all => :test
155
- else
156
- task :all => [:test, "test:integration"]
157
- end
158
- end
data/Release.md DELETED
@@ -1,9 +0,0 @@
1
- # Release process
2
-
3
- Using "3.7.1" as a version string example.
4
-
5
- 1. `be rake release_sanity VERSION=3.7.1`
6
- 2. `be rake release VERSION=3.7.1`
7
- 3. Switch to latest JRuby version
8
- 4. `rake java gem`
9
- 5. `gem push pkg/puma-3.7.1-java.gem`
data/gemfiles/2.1-Gemfile DELETED
@@ -1,12 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "hoe"
4
- gem "hoe-git"
5
- gem "hoe-ignore"
6
- gem "rdoc"
7
- gem "rake-compiler"
8
-
9
- gem "rack", "~> 1.6"
10
- gem "minitest", '~> 5.9'
11
-
12
- gem "jruby-openssl", :platform => "jruby"
data/lib/puma/compat.rb DELETED
@@ -1,14 +0,0 @@
1
- # Provides code to work properly on 1.8 and 1.9
2
-
3
- class String
4
- unless method_defined? :bytesize
5
- alias_method :bytesize, :size
6
- end
7
-
8
- unless method_defined? :byteslice
9
- def byteslice(*arg)
10
- enc = self.encoding
11
- self.dup.force_encoding(Encoding::ASCII_8BIT).slice(*arg).force_encoding(enc)
12
- end
13
- end
14
- end
@@ -1,23 +0,0 @@
1
- require 'puma/launcher'
2
- require 'puma/configuration'
3
-
4
- module Puma
5
- def self.run(opts={})
6
- cfg = Puma::Configuration.new do |user_config|
7
- if port = opts[:port]
8
- user_config.port port
9
- end
10
-
11
- user_config.quiet
12
-
13
- yield c
14
- end
15
-
16
- cfg.clamp
17
-
18
- events = Puma::Events.null
19
-
20
- launcher = Puma::Launcher.new cfg, :events => events
21
- launcher.run
22
- end
23
- end
@@ -1,31 +0,0 @@
1
- module Process
2
-
3
- # This overrides the default version because it is broken if it
4
- # exists.
5
-
6
- if respond_to? :daemon
7
- class << self
8
- remove_method :daemon
9
- end
10
- end
11
-
12
- def self.daemon(nochdir=false, noclose=false)
13
- exit if fork # Parent exits, child continues.
14
-
15
- Process.setsid # Become session leader.
16
-
17
- exit if fork # Zap session leader. See [1].
18
-
19
- Dir.chdir "/" unless nochdir # Release old working directory.
20
-
21
- if !noclose
22
- STDIN.reopen File.open("/dev/null", "r")
23
-
24
- null_out = File.open "/dev/null", "w"
25
- STDOUT.reopen null_out
26
- STDERR.reopen null_out
27
- end
28
-
29
- 0
30
- end
31
- end
@@ -1,11 +0,0 @@
1
- module Puma
2
- module Delegation
3
- def forward(what, who)
4
- module_eval <<-CODE
5
- def #{what}(*args, &block)
6
- #{who}.#{what}(*args, &block)
7
- end
8
- CODE
9
- end
10
- end
11
- end
@@ -1,45 +0,0 @@
1
- require 'java'
2
-
3
- # Conservative native JRuby/Java implementation of IOBuffer
4
- # backed by a ByteArrayOutputStream and conversion between
5
- # Ruby String and Java bytes
6
- module Puma
7
- class JavaIOBuffer < java.io.ByteArrayOutputStream
8
- field_reader :buf
9
- end
10
-
11
- class IOBuffer
12
- BUF_DEFAULT_SIZE = 4096
13
-
14
- def initialize
15
- @buf = JavaIOBuffer.new(BUF_DEFAULT_SIZE)
16
- end
17
-
18
- def reset
19
- @buf.reset
20
- end
21
-
22
- def <<(str)
23
- bytes = str.to_java_bytes
24
- @buf.write(bytes, 0, bytes.length)
25
- end
26
-
27
- def append(*strs)
28
- strs.each { |s| self << s; }
29
- end
30
-
31
- def to_s
32
- String.from_java_bytes @buf.to_byte_array
33
- end
34
-
35
- alias_method :to_str, :to_s
36
-
37
- def used
38
- @buf.size
39
- end
40
-
41
- def capacity
42
- @buf.buf.length
43
- end
44
- end
45
- end
@@ -1,33 +0,0 @@
1
- # :stopdoc:
2
-
3
- require 'uri/common'
4
-
5
- # Issue:
6
- # http://bugs.ruby-lang.org/issues/5925
7
- #
8
- # Relevant commit:
9
- # https://github.com/ruby/ruby/commit/edb7cdf1eabaff78dfa5ffedfbc2e91b29fa9ca1
10
-
11
-
12
- module URI
13
- begin
14
- 256.times do |i|
15
- TBLENCWWWCOMP_[i.chr] = '%%%02X' % i
16
- end
17
- TBLENCWWWCOMP_[' '] = '+'
18
- TBLENCWWWCOMP_.freeze
19
-
20
- 256.times do |i|
21
- h, l = i>>4, i&15
22
- TBLDECWWWCOMP_['%%%X%X' % [h, l]] = i.chr
23
- TBLDECWWWCOMP_['%%%x%X' % [h, l]] = i.chr
24
- TBLDECWWWCOMP_['%%%X%x' % [h, l]] = i.chr
25
- TBLDECWWWCOMP_['%%%x%x' % [h, l]] = i.chr
26
- end
27
- TBLDECWWWCOMP_['+'] = ' '
28
- TBLDECWWWCOMP_.freeze
29
- rescue Exception
30
- end
31
- end
32
-
33
- # :startdoc: