puma 2.0.0.b7-java → 2.0.0-java

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.

@@ -1,3 +1,20 @@
1
+ === 2.0.0 / 2013-04-29
2
+
3
+ RailsConf 2013 edition!
4
+
5
+ * 2 doc changes:
6
+ * Start with rackup -s Puma, NOT rackup -s puma.
7
+ * Minor doc fixes in the README.md, Capistrano section
8
+
9
+ * 2 bug fixes:
10
+ * Fix reading RACK_ENV properly. Fixes #234
11
+ * Make cap recipe handle tmp/sockets; fixes #228
12
+
13
+ * 3 minor changes:
14
+ * Fix capistrano recipe
15
+ * Fix stdout/stderr logs to sync outputs
16
+ * allow binding to IPv6 addresses
17
+
1
18
  === 2.0.0.b7 / 2013-03-18
2
19
 
3
20
  * 5 minor enhancements:
data/README.md CHANGED
@@ -51,7 +51,7 @@ Then start your server with the `rails` command:
51
51
 
52
52
  You can pass it as an option to `rackup`:
53
53
 
54
- $ rackup -s puma
54
+ $ rackup -s Puma
55
55
 
56
56
  Alternatively, you can modify your `config.ru` to choose Puma by default, by adding the following as the first line:
57
57
 
@@ -146,7 +146,7 @@ If you want an easy way to manage multiple scripts at once check [tools/jungle](
146
146
 
147
147
  ## Capistrano deployment
148
148
 
149
- Puma has included Capistrano [deploy script](https://github.com/plentz/puma/blob/master/lib/puma/capistrano.rb), you just need require that:
149
+ Puma has included Capistrano [deploy script](https://github.com/puma/puma/blob/master/lib/puma/capistrano.rb), you just need require that:
150
150
 
151
151
  config/deploy.rb
152
152
 
@@ -157,9 +157,9 @@ require 'puma/capistrano'
157
157
  and then
158
158
 
159
159
  ```bash
160
- $ bunde exec cap puma:start
161
- $ bunde exec cap puma:restart
162
- $ bunde exec cap puma:stop
160
+ $ bundle exec cap puma:start
161
+ $ bundle exec cap puma:restart
162
+ $ bundle exec cap puma:stop
163
163
  ```
164
164
 
165
165
 
@@ -53,7 +53,7 @@ server {
53
53
  # rewite the url to have explicit .html on the end
54
54
  # and then send it on its way to the next config rule.
55
55
  # if there is no file on the fs then it sets all the
56
- # necessary headers and proxies to our upstream mongrels
56
+ # necessary headers and proxies to our upstream pumas
57
57
  if (-f $request_filename.html) {
58
58
  rewrite (.*) $1.html break;
59
59
  }
@@ -66,12 +66,7 @@ server {
66
66
 
67
67
  # Now this supposedly should work as it gets the filenames with querystrings that Rails provides.
68
68
  # BUT there's a chance it could break the ajax calls.
69
- location ~* \.(ico|css|gif|jpe?g|png)(\?[0-9]+)?$ {
70
- expires max;
71
- break;
72
- }
73
-
74
- location ~ ^/javascripts/.*\.js(\?[0-9]+)?$ {
69
+ location ~* \.(ico|css|gif|jpe?g|png|js)(\?[0-9]+)?$ {
75
70
  expires max;
76
71
  break;
77
72
  }
@@ -163,6 +163,7 @@ module Puma
163
163
  # allow to accumulate before returning connection refused.
164
164
  #
165
165
  def add_tcp_listener(host, port, optimize_for_latency=true, backlog=1024)
166
+ host = host[1..-2] if host[0..0] == '['
166
167
  s = TCPServer.new(host, port)
167
168
  if optimize_for_latency
168
169
  s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
@@ -3,6 +3,11 @@ Capistrano::Configuration.instance.load do
3
3
  after 'deploy:start', 'puma:start'
4
4
  after 'deploy:restart', 'puma:restart'
5
5
 
6
+ # Ensure the tmp/sockets directory is created by the deploy:setup task and
7
+ # symlinked in by the deploy:update task. This is not handled by Capistrano
8
+ # v2 but is fixed in v3.
9
+ shared_children.push('tmp/sockets')
10
+
6
11
  _cset(:puma_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec puma" }
7
12
  _cset(:pumactl_cmd) { "#{fetch(:bundle_cmd, 'bundle')} exec pumactl" }
8
13
  _cset(:puma_state) { "#{shared_path}/sockets/puma.state" }
@@ -17,12 +22,12 @@ Capistrano::Configuration.instance.load do
17
22
 
18
23
  desc 'Stop puma'
19
24
  task :stop, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
20
- run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S fetch(:puma_state) stop"
25
+ run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} stop"
21
26
  end
22
27
 
23
28
  desc 'Restart puma'
24
29
  task :restart, :roles => lambda { fetch(:puma_role) }, :on_no_matching_servers => :continue do
25
- run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S fetch(:puma_state) restart"
30
+ run "cd #{current_path} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} restart"
26
31
  end
27
32
  end
28
33
  end
@@ -179,8 +179,7 @@ module Puma
179
179
  :binds => [],
180
180
  :workers => 0,
181
181
  :daemon => false,
182
- :worker_boot => [],
183
- :environment => "development"
182
+ :worker_boot => []
184
183
  }
185
184
 
186
185
  @parser = OptionParser.new do |o|
@@ -270,9 +269,6 @@ module Puma
270
269
 
271
270
  o.on "-w", "--workers COUNT",
272
271
  "Activate cluster mode: How many worker processes to create" do |arg|
273
- unsupported "-w not supported on JRuby and Windows",
274
- jruby? || windows?
275
-
276
272
  @options[:workers] = arg.to_i
277
273
  end
278
274
 
@@ -301,9 +297,12 @@ module Puma
301
297
  # Try the user option first, then the environment variable,
302
298
  # finally default to development
303
299
 
304
- ENV['RACK_ENV'] = @options[:environment] ||
305
- ENV['RACK_ENV'] ||
306
- 'development'
300
+ env = @options[:environment] ||
301
+ ENV['RACK_ENV'] ||
302
+ 'development'
303
+
304
+ @options[:environment] = env
305
+ ENV['RACK_ENV'] = env
307
306
  end
308
307
 
309
308
  def delete_pidfile
@@ -346,6 +345,11 @@ module Puma
346
345
  Puma.cli_config = @config
347
346
 
348
347
  @config.load
348
+
349
+ if @options[:workers]
350
+ unsupported "worker mode not supported on JRuby and Windows",
351
+ jruby? || windows?
352
+ end
349
353
  end
350
354
 
351
355
  def graceful_stop(server)
@@ -364,11 +368,13 @@ module Puma
364
368
  if stdout
365
369
  @io_redirected = true
366
370
  STDOUT.reopen stdout, (append ? "a" : "w")
371
+ STDOUT.sync = true
367
372
  STDOUT.puts "=== puma startup: #{Time.now} ==="
368
373
  end
369
374
 
370
375
  if stderr
371
376
  STDERR.reopen stderr, (append ? "a" : "w")
377
+ STDERR.sync = true
372
378
  STDERR.puts "=== puma startup: #{Time.now} ==="
373
379
  end
374
380
  end
@@ -28,7 +28,7 @@ module Puma
28
28
  # too taxing on performance.
29
29
  module Const
30
30
 
31
- PUMA_VERSION = VERSION = "2.0.0.b7".freeze
31
+ PUMA_VERSION = VERSION = "2.0.0".freeze
32
32
 
33
33
  FAST_TRACK_KA_TIMEOUT = 0.2
34
34
 
Binary file
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "puma"
5
- s.version = "2.0.0.b7"
5
+ s.version = "2.0.0"
6
6
 
7
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Phoenix"]
9
- s.date = "2013-03-19"
9
+ s.date = "2013-04-29"
10
10
  s.description = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for [Rubinius](http://rubini.us), but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.\n\nUnder the hood, Puma processes requests using a C-optimized Ragel extension (inherited from Mongrel) that provides fast, accurate HTTP 1.1 protocol parsing in a portable way. Puma then serves the request in a thread from an internal thread pool (which you can control). This allows Puma to provide real concurrency for your web application!\n\nWith Rubinius 2.0, Puma will utilize all cores on your CPU with real threads, meaning you won't have to spawn multiple processes to increase throughput. You can expect to see a similar benefit from JRuby.\n\nOn MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries). Your mileage may vary. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like [Rubinius](http://rubini.us) or [JRuby](http://jruby.org)."
11
11
  s.email = ["evan@phx.io"]
12
12
  s.executables = ["puma", "pumactl"]
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 2.0.0.b7
4
+ prerelease:
5
+ version: 2.0.0
6
6
  platform: java
7
7
  authors:
8
8
  - Evan Phoenix
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-03-19 00:00:00 Z
13
+ date: 2013-04-29 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -173,9 +173,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements:
176
- - - ">"
176
+ - - ">="
177
177
  - !ruby/object:Gem::Version
178
- version: 1.3.1
178
+ version: "0"
179
179
  requirements: []
180
180
 
181
181
  rubyforge_project: puma