puma 3.9.1 → 4.3.1

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 (82) hide show
  1. checksums.yaml +5 -5
  2. data/History.md +232 -0
  3. data/README.md +162 -224
  4. data/docs/architecture.md +37 -0
  5. data/{DEPLOYMENT.md → docs/deployment.md} +24 -4
  6. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  7. data/docs/images/puma-connection-flow.png +0 -0
  8. data/docs/images/puma-general-arch.png +0 -0
  9. data/docs/plugins.md +38 -0
  10. data/docs/restart.md +41 -0
  11. data/docs/signals.md +56 -3
  12. data/docs/systemd.md +130 -37
  13. data/docs/tcp_mode.md +96 -0
  14. data/ext/puma_http11/PumaHttp11Service.java +2 -0
  15. data/ext/puma_http11/extconf.rb +13 -0
  16. data/ext/puma_http11/http11_parser.c +115 -140
  17. data/ext/puma_http11/http11_parser.java.rl +21 -37
  18. data/ext/puma_http11/http11_parser.rl +9 -9
  19. data/ext/puma_http11/http11_parser_common.rl +3 -3
  20. data/ext/puma_http11/mini_ssl.c +104 -8
  21. data/ext/puma_http11/org/jruby/puma/Http11.java +106 -114
  22. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +90 -108
  23. data/ext/puma_http11/org/jruby/puma/IOBuffer.java +72 -0
  24. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +21 -4
  25. data/ext/puma_http11/puma_http11.c +2 -0
  26. data/lib/puma.rb +16 -0
  27. data/lib/puma/accept_nonblock.rb +7 -1
  28. data/lib/puma/app/status.rb +40 -26
  29. data/lib/puma/binder.rb +57 -74
  30. data/lib/puma/cli.rb +26 -7
  31. data/lib/puma/client.rb +243 -190
  32. data/lib/puma/cluster.rb +78 -34
  33. data/lib/puma/commonlogger.rb +2 -0
  34. data/lib/puma/configuration.rb +24 -16
  35. data/lib/puma/const.rb +36 -18
  36. data/lib/puma/control_cli.rb +46 -19
  37. data/lib/puma/detect.rb +2 -0
  38. data/lib/puma/dsl.rb +329 -68
  39. data/lib/puma/events.rb +6 -1
  40. data/lib/puma/io_buffer.rb +3 -6
  41. data/lib/puma/jruby_restart.rb +2 -1
  42. data/lib/puma/launcher.rb +120 -58
  43. data/lib/puma/minissl.rb +69 -27
  44. data/lib/puma/minissl/context_builder.rb +76 -0
  45. data/lib/puma/null_io.rb +2 -0
  46. data/lib/puma/plugin.rb +7 -2
  47. data/lib/puma/plugin/tmp_restart.rb +2 -1
  48. data/lib/puma/rack/builder.rb +4 -1
  49. data/lib/puma/rack/urlmap.rb +2 -0
  50. data/lib/puma/rack_default.rb +2 -0
  51. data/lib/puma/reactor.rb +224 -34
  52. data/lib/puma/runner.rb +25 -4
  53. data/lib/puma/server.rb +148 -62
  54. data/lib/puma/single.rb +16 -5
  55. data/lib/puma/state_file.rb +2 -0
  56. data/lib/puma/tcp_logger.rb +2 -0
  57. data/lib/puma/thread_pool.rb +61 -38
  58. data/lib/puma/util.rb +2 -6
  59. data/lib/rack/handler/puma.rb +10 -4
  60. data/tools/docker/Dockerfile +16 -0
  61. data/tools/jungle/README.md +12 -2
  62. data/tools/jungle/init.d/README.md +2 -0
  63. data/tools/jungle/init.d/puma +8 -8
  64. data/tools/jungle/init.d/run-puma +1 -1
  65. data/tools/jungle/rc.d/README.md +74 -0
  66. data/tools/jungle/rc.d/puma +61 -0
  67. data/tools/jungle/rc.d/puma.conf +10 -0
  68. data/tools/trickletest.rb +1 -2
  69. metadata +29 -56
  70. data/.github/issue_template.md +0 -20
  71. data/Gemfile +0 -14
  72. data/Manifest.txt +0 -78
  73. data/Rakefile +0 -165
  74. data/Release.md +0 -9
  75. data/gemfiles/2.1-Gemfile +0 -12
  76. data/lib/puma/compat.rb +0 -14
  77. data/lib/puma/convenient.rb +0 -23
  78. data/lib/puma/daemon_ext.rb +0 -31
  79. data/lib/puma/delegation.rb +0 -11
  80. data/lib/puma/java_io_buffer.rb +0 -45
  81. data/lib/puma/rack/backports/uri/common_193.rb +0 -33
  82. data/puma.gemspec +0 -20
@@ -0,0 +1,61 @@
1
+ #!/bin/sh
2
+ #
3
+
4
+ # PROVIDE: puma
5
+
6
+ . /etc/rc.subr
7
+
8
+ name="puma"
9
+ start_cmd="puma_start"
10
+ stop_cmd="puma_stop"
11
+ restart_cmd="puma_restart"
12
+ rcvar=puma_enable
13
+ required_files=/usr/local/etc/puma.conf
14
+
15
+ puma_start()
16
+ {
17
+ server_count=$(/usr/local/bin/jq ".servers[] .ruby_env" /usr/local/etc/puma.conf | wc -l)
18
+ i=0
19
+ while [ "$i" -lt "$server_count" ]; do
20
+ rb_env=$(/usr/local/bin/jq -r ".servers[$i].ruby_env" /usr/local/etc/puma.conf)
21
+ dir=$(/usr/local/bin/jq -r ".servers[$i].dir" /usr/local/etc/puma.conf)
22
+ user=$(/usr/local/bin/jq -r ".servers[$i].user" /usr/local/etc/puma.conf)
23
+ rb_ver=$(/usr/local/bin/jq -r ".servers[$i].ruby_version" /usr/local/etc/puma.conf)
24
+ case $rb_env in
25
+ "rbenv")
26
+ su - $user -c "cd $dir && rbenv shell $rb_ver && bundle exec puma -C $dir/config/puma.rb -d"
27
+ ;;
28
+ *)
29
+ ;;
30
+ esac
31
+ i=$(( i + 1 ))
32
+ done
33
+ }
34
+
35
+ puma_stop()
36
+ {
37
+ pkill ruby
38
+ }
39
+
40
+ puma_restart()
41
+ {
42
+ server_count=$(/usr/local/bin/jq ".servers[] .ruby_env" /usr/local/etc/puma.conf | wc -l)
43
+ i=0
44
+ while [ "$i" -lt "$server_count" ]; do
45
+ rb_env=$(/usr/local/bin/jq -r ".servers[$i].ruby_env" /usr/local/etc/puma.conf)
46
+ dir=$(/usr/local/bin/jq -r ".servers[$i].dir" /usr/local/etc/puma.conf)
47
+ user=$(/usr/local/bin/jq -r ".servers[$i].user" /usr/local/etc/puma.conf)
48
+ rb_ver=$(/usr/local/bin/jq -r ".servers[$i].ruby_version" /usr/local/etc/puma.conf)
49
+ case $rb_env in
50
+ "rbenv")
51
+ su - $user -c "cd $dir && pkill ruby && rbenv shell $ruby_version && bundle exec puma -C $dir/config/puma.rb -d"
52
+ ;;
53
+ *)
54
+ ;;
55
+ esac
56
+ i=$(( i + 1 ))
57
+ done
58
+ }
59
+
60
+ load_rc_config $name
61
+ run_rc_command "$1"
@@ -0,0 +1,10 @@
1
+ {
2
+ "servers" : [
3
+ {
4
+ "dir": "/path/to/rails/project",
5
+ "user": "deploy-user",
6
+ "ruby_version": "ruby.version",
7
+ "ruby_env": "rbenv"
8
+ }
9
+ ]
10
+ }
@@ -31,14 +31,13 @@ st = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\nCon
31
31
  puts "length: #{content.length}"
32
32
 
33
33
  threads = []
34
- ARGV[1].to_i.times do
34
+ ARGV[1].to_i.times do
35
35
  t = Thread.new do
36
36
  size = 100
37
37
  puts ">>>> #{size} sized chunks"
38
38
  do_test(st, size)
39
39
  end
40
40
 
41
- t.abort_on_exception = true
42
41
  threads << t
43
42
  end
44
43
 
metadata CHANGED
@@ -1,47 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.1
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-03 00:00:00.000000000 Z
11
+ date: 2019-12-05 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: hoe
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.15'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.15'
26
+ version: '2.0'
41
27
  description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server
42
28
  for Ruby/Rack applications. Puma is intended for use in both development and production
43
- environments. In order to get the best throughput, it is highly recommended that
44
- 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.
45
31
  email:
46
32
  - evan@phx.io
47
33
  executables:
@@ -49,35 +35,25 @@ executables:
49
35
  - pumactl
50
36
  extensions:
51
37
  - ext/puma_http11/extconf.rb
52
- extra_rdoc_files:
53
- - ".github/issue_template.md"
54
- - DEPLOYMENT.md
55
- - History.md
56
- - Manifest.txt
57
- - README.md
58
- - Release.md
59
- - docs/nginx.md
60
- - docs/signals.md
61
- - docs/systemd.md
62
- - tools/jungle/README.md
63
- - tools/jungle/init.d/README.md
64
- - tools/jungle/upstart/README.md
38
+ extra_rdoc_files: []
65
39
  files:
66
- - ".github/issue_template.md"
67
- - DEPLOYMENT.md
68
- - Gemfile
69
40
  - History.md
70
41
  - LICENSE
71
- - Manifest.txt
72
42
  - README.md
73
- - Rakefile
74
- - Release.md
75
43
  - bin/puma
76
44
  - bin/puma-wild
77
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
78
51
  - docs/nginx.md
52
+ - docs/plugins.md
53
+ - docs/restart.md
79
54
  - docs/signals.md
80
55
  - docs/systemd.md
56
+ - docs/tcp_mode.md
81
57
  - ext/puma_http11/PumaHttp11Service.java
82
58
  - ext/puma_http11/ext_help.h
83
59
  - ext/puma_http11/extconf.rb
@@ -90,9 +66,9 @@ files:
90
66
  - ext/puma_http11/mini_ssl.c
91
67
  - ext/puma_http11/org/jruby/puma/Http11.java
92
68
  - ext/puma_http11/org/jruby/puma/Http11Parser.java
69
+ - ext/puma_http11/org/jruby/puma/IOBuffer.java
93
70
  - ext/puma_http11/org/jruby/puma/MiniSSL.java
94
71
  - ext/puma_http11/puma_http11.c
95
- - gemfiles/2.1-Gemfile
96
72
  - lib/puma.rb
97
73
  - lib/puma/accept_nonblock.rb
98
74
  - lib/puma/app/status.rb
@@ -101,25 +77,20 @@ files:
101
77
  - lib/puma/client.rb
102
78
  - lib/puma/cluster.rb
103
79
  - lib/puma/commonlogger.rb
104
- - lib/puma/compat.rb
105
80
  - lib/puma/configuration.rb
106
81
  - lib/puma/const.rb
107
82
  - lib/puma/control_cli.rb
108
- - lib/puma/convenient.rb
109
- - lib/puma/daemon_ext.rb
110
- - lib/puma/delegation.rb
111
83
  - lib/puma/detect.rb
112
84
  - lib/puma/dsl.rb
113
85
  - lib/puma/events.rb
114
86
  - lib/puma/io_buffer.rb
115
- - lib/puma/java_io_buffer.rb
116
87
  - lib/puma/jruby_restart.rb
117
88
  - lib/puma/launcher.rb
118
89
  - lib/puma/minissl.rb
90
+ - lib/puma/minissl/context_builder.rb
119
91
  - lib/puma/null_io.rb
120
92
  - lib/puma/plugin.rb
121
93
  - lib/puma/plugin/tmp_restart.rb
122
- - lib/puma/rack/backports/uri/common_193.rb
123
94
  - lib/puma/rack/builder.rb
124
95
  - lib/puma/rack/urlmap.rb
125
96
  - lib/puma/rack_default.rb
@@ -132,11 +103,14 @@ files:
132
103
  - lib/puma/thread_pool.rb
133
104
  - lib/puma/util.rb
134
105
  - lib/rack/handler/puma.rb
135
- - puma.gemspec
106
+ - tools/docker/Dockerfile
136
107
  - tools/jungle/README.md
137
108
  - tools/jungle/init.d/README.md
138
109
  - tools/jungle/init.d/puma
139
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
140
114
  - tools/jungle/upstart/README.md
141
115
  - tools/jungle/upstart/puma-manager.conf
142
116
  - tools/jungle/upstart/puma.conf
@@ -144,26 +118,25 @@ files:
144
118
  homepage: http://puma.io
145
119
  licenses:
146
120
  - BSD-3-Clause
147
- metadata: {}
121
+ metadata:
122
+ msys2_mingw_dependencies: openssl
123
+ changelog_uri: https://github.com/puma/puma/blob/master/History.md
148
124
  post_install_message:
149
- rdoc_options:
150
- - "--main"
151
- - README.md
125
+ rdoc_options: []
152
126
  require_paths:
153
127
  - lib
154
128
  required_ruby_version: !ruby/object:Gem::Requirement
155
129
  requirements:
156
130
  - - ">="
157
131
  - !ruby/object:Gem::Version
158
- version: 1.9.3
132
+ version: '2.2'
159
133
  required_rubygems_version: !ruby/object:Gem::Requirement
160
134
  requirements:
161
135
  - - ">="
162
136
  - !ruby/object:Gem::Version
163
137
  version: '0'
164
138
  requirements: []
165
- rubyforge_project:
166
- rubygems_version: 2.6.11
139
+ rubygems_version: 3.0.3
167
140
  signing_key:
168
141
  specification_version: 4
169
142
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for
@@ -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,14 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- gem "hoe"
6
- gem "hoe-git"
7
- gem "hoe-ignore"
8
- gem "rdoc"
9
- gem "rake-compiler"
10
-
11
- gem "rack", "< 3.0"
12
- gem "minitest", "~> 5.9"
13
-
14
- gem "jruby-openssl", :platform => "jruby"
@@ -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,165 +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
- # Keep in sync with puma.gemspec
12
- HOE = Hoe.spec "puma" do
13
- self.readme_file = "README.md"
14
- self.urls = %w!http://puma.io https://github.com/puma/puma!
15
-
16
- license "BSD-3-Clause"
17
- developer 'Evan Phoenix', 'evan@phx.io'
18
-
19
- spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
20
- spec_extras[:executables] = ['puma', 'pumactl']
21
- spec_extras[:homepage] = urls.first
22
-
23
- require_ruby_version ">= 1.9.3"
24
- end
25
-
26
- task :prerelease => [:clobber, :check_manifest, :test]
27
-
28
- # hoe/test and rake-compiler don't seem to play well together, so disable
29
- # hoe/test's .gemtest touch file thingy for now
30
- HOE.spec.files -= [".gemtest"]
31
-
32
- include Hoe::Git
33
-
34
- desc "Print the current changelog."
35
- task "changelog" do
36
- tag = ENV["FROM"] || git_tags.last
37
- range = [tag, "HEAD"].compact.join ".."
38
- cmd = "git log #{range} '--format=tformat:%B|||%aN|||%aE|||'"
39
- now = Time.new.strftime "%Y-%m-%d"
40
-
41
- changes = `#{cmd}`.split(/\|\|\|/).each_slice(3).map { |msg, author, email|
42
- msg.split(/\n/).reject { |s| s.empty? }.first
43
- }.flatten.compact
44
-
45
- $changes = Hash.new { |h,k| h[k] = [] }
46
-
47
- codes = {
48
- "!" => :major,
49
- "+" => :minor,
50
- "*" => :minor,
51
- "-" => :bug,
52
- "?" => :unknown,
53
- }
54
-
55
- codes_re = Regexp.escape codes.keys.join
56
-
57
- changes.each do |change|
58
- if change =~ /^\s*([#{codes_re}])\s*(.*)/ then
59
- code, line = codes[$1], $2
60
- else
61
- code, line = codes["?"], change.chomp
62
- end
63
-
64
- $changes[code] << line
65
- end
66
-
67
- puts "## #{ENV['VERSION'] || 'NEXT'} / #{now}"
68
- puts
69
- changelog_section :major
70
- changelog_section :minor
71
- changelog_section :bug
72
- changelog_section :unknown
73
- puts
74
- end
75
-
76
- # generate extension code using Ragel (C and Java)
77
- desc "Generate extension code (C and Java) using Ragel"
78
- task :ragel
79
-
80
- file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
81
- begin
82
- sh "ragel #{t.prerequisites.last} -C -G2 -I ext/puma_http11 -o #{t.name}"
83
- rescue
84
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
85
- end
86
- end
87
- task :ragel => ['ext/puma_http11/http11_parser.c']
88
-
89
- file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
90
- begin
91
- sh "ragel #{t.prerequisites.last} -J -G2 -I ext/puma_http11 -o #{t.name}"
92
- rescue
93
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
94
- end
95
- end
96
- task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java']
97
-
98
- if !IS_JRUBY
99
-
100
- # compile extensions using rake-compiler
101
- # C (MRI, Rubinius)
102
- Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext|
103
- # place extension inside namespace
104
- ext.lib_dir = "lib/puma"
105
-
106
- ext.cross_compile = true
107
- ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']
108
- ext.cross_compiling do |spec|
109
- # add fat-binary stub only when cross compiling
110
- spec.files << "lib/puma/puma_http11.rb"
111
- end
112
-
113
- CLEAN.include "lib/puma/{1.8,1.9}"
114
- CLEAN.include "lib/puma/puma_http11.rb"
115
- end
116
-
117
- else
118
-
119
- # Java (JRuby)
120
- Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext|
121
- ext.lib_dir = "lib/puma"
122
- end
123
-
124
- end
125
-
126
- # the following is a fat-binary stub that will be used when
127
- # require 'puma/puma_http11' and will use either 1.8 or 1.9 version depending
128
- # on RUBY_VERSION
129
- file "lib/puma/puma_http11.rb" do |t|
130
- File.open(t.name, "w") do |f|
131
- f.puts "RUBY_VERSION =~ /(\d+.\d+)/"
132
- f.puts 'require "puma/#{$1}/puma_http11"'
133
- end
134
- end
135
-
136
- # tests require extension be compiled, but depend on the platform
137
- if IS_JRUBY
138
- task :test => [:java]
139
- else
140
- task :test => [:compile]
141
- end
142
-
143
- task :test => [:ensure_no_puma_gem]
144
- task :ensure_no_puma_gem do
145
- Bundler.with_clean_env do
146
- out = `gem list puma`.strip
147
- if !$?.success? || out != ""
148
- abort "No other puma version should be install to avoid false positives or lading it by accident but found #{out}"
149
- end
150
- end
151
- end
152
-
153
- namespace :test do
154
- desc "Run the integration tests"
155
- task :integration do
156
- sh "cd test/shell; sh run.sh"
157
- end
158
-
159
- desc "Run all tests"
160
- if defined?(JRUBY_VERSION) and ENV['TRAVIS']
161
- task :all => :test
162
- else
163
- task :all => [:test, "test:integration"]
164
- end
165
- end