puma 3.0.2 → 3.1.0

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e38706b39e9afd3162b1c9ced04cb0f856e31706
4
- data.tar.gz: b81aadfa3ed39aa205704e0d497c559be4e88259
3
+ metadata.gz: 830c9d3efc0d75b127a845f9598ae5c1059de586
4
+ data.tar.gz: 1dda7e6c8f4de27b0443f8a686ec251251ac40da
5
5
  SHA512:
6
- metadata.gz: 5ca710aedc31a5e20d37d1fe656892837225ba1980c6fc5c368d8fba6704493483ca8cee2668b4491d41523d193f921b4580b6f4441a13cb7405a33eacdd2d8e
7
- data.tar.gz: e931f560ea6b6edee01240041c654099187d411f18a49c07709243740b52efad89c86b23500f0aeb067f0dfcfdb9455cc56e8d0289bcf232a5a80a909bc24629
6
+ metadata.gz: 967d992a2f7d569ba91881649d7acdc8a9782ec3ee0a992d5eee4b4ab999b786189b6c5b33f530c63ca6bb4cc42ac0ddf22b0061da0c6dd656c28fd71594c40f
7
+ data.tar.gz: 43a7eb4409820f3b031f9bb5684c60787e755862c1cf249d66bf9a35e1b48e35dc383b74983838091463abca4c5bd154a9cef8fed4234e81ecefbf08c612dcb2
@@ -1,3 +1,14 @@
1
+ === 3.1.0 / 2016-03-05
2
+
3
+ * 1 minor feature:
4
+ * Add 'import' directive to config file. Fixes #916
5
+
6
+ * 5 bug fixes:
7
+ * Add 'fetch' to options. Fixes #913
8
+ * Fix jruby daemonization. Fixes #918
9
+ * Recreate the proper args manually. Fixes #910
10
+ * Require 'time' to get iso8601. Fixes #914
11
+
1
12
  === 3.0.2 / 2016-02-26
2
13
 
3
14
  * 5 bug fixes:
@@ -1,4 +1,5 @@
1
1
  require 'puma/runner'
2
+ require 'time'
2
3
 
3
4
  module Puma
4
5
  class Cluster < Runner
@@ -44,6 +44,12 @@ module Puma
44
44
  end
45
45
  end
46
46
 
47
+ def fetch(key, default=nil)
48
+ val = self[key]
49
+ return val if val
50
+ default
51
+ end
52
+
47
53
  attr_reader :cur
48
54
 
49
55
  def all_of(key)
@@ -99,8 +99,8 @@ module Puma
99
99
  # too taxing on performance.
100
100
  module Const
101
101
 
102
- PUMA_VERSION = VERSION = "3.0.2".freeze
103
- CODE_NAME = "Plethora of Penguin Pinatas".freeze
102
+ PUMA_VERSION = VERSION = "3.1.0".freeze
103
+ CODE_NAME = "El Niño Winter Wonderland".freeze
104
104
 
105
105
  FAST_TRACK_KA_TIMEOUT = 0.2
106
106
 
@@ -237,15 +237,14 @@ module Puma
237
237
  def start
238
238
  require 'puma/cli'
239
239
 
240
- run_args = @argv
241
-
242
- if path = @state
243
- run_args = ["-S", path] + run_args
244
- end
245
-
246
- if path = @config_file
247
- run_args = ["-C", path] + run_args
248
- end
240
+ run_args = []
241
+
242
+ run_args += ["-S", @state] if @state
243
+ run_args += ["-q"] if @quiet
244
+ run_args += ["--pidfile", @pidfile] if @pidfile
245
+ run_args += ["--control", @control_url] if @control_url
246
+ run_args += ["--control-token", @control_auth_token] if @control_auth_token
247
+ run_args += ["-C", @config_file] if @config_file
249
248
 
250
249
  events = Puma::Events.new @stdout, @stderr
251
250
 
@@ -21,7 +21,10 @@ module Puma
21
21
  end
22
22
 
23
23
  def _load_from(path)
24
- instance_eval(File.read(path), path, 1) if path
24
+ if path
25
+ @path = path
26
+ instance_eval(File.read(path), path, 1)
27
+ end
25
28
  ensure
26
29
  _offer_plugins
27
30
  end
@@ -47,6 +50,26 @@ module Puma
47
50
  instance_eval(&blk)
48
51
  end
49
52
 
53
+ # Load configuration from another named file. If the file name is absolute,
54
+ # load the file as an absolute path. Otherwise load it relative to the
55
+ # current config file.
56
+ #
57
+ def import(file)
58
+ if File.extname(file) == ""
59
+ file += ".rb"
60
+ end
61
+
62
+ if file[0,1] == "/"
63
+ path = file
64
+ elsif @path
65
+ path = File.join File.dirname(@path), file
66
+ else
67
+ raise "No original configuration path to import relative to"
68
+ end
69
+
70
+ DSL.new(@options, @config)._load_from(path)
71
+ end
72
+
50
73
  def get(key,default=nil)
51
74
  @options[key.to_sym] || default
52
75
  end
@@ -61,7 +61,7 @@ module Puma
61
61
  end
62
62
 
63
63
  def self.daemon_start(dir, argv)
64
- ENV['PUMA_DAEMON_RESTART'] = Process.pid.to_s
64
+ ENV[RestartKey] = Process.pid.to_s
65
65
 
66
66
  if k = ENV['PUMA_JRUBY_DAEMON_OPTS']
67
67
  ENV['JRUBY_OPTS'] = k
@@ -191,6 +191,15 @@ module Puma
191
191
  @binder.connected_port
192
192
  end
193
193
 
194
+ def restart_args
195
+ cmd = @options[:restart_cmd]
196
+ if cmd
197
+ cmd.split(' ') + @original_argv
198
+ else
199
+ @restart_argv
200
+ end
201
+ end
202
+
194
203
  private
195
204
 
196
205
  def reload_worker_directory
@@ -260,15 +269,6 @@ module Puma
260
269
  (@options[:workers] || 0) > 0
261
270
  end
262
271
 
263
- def restart_args
264
- cmd = @options[:restart_cmd]
265
- if cmd
266
- cmd.split(' ') + @original_argv
267
- else
268
- @restart_argv
269
- end
270
- end
271
-
272
272
  def unsupported(str)
273
273
  @events.error(str)
274
274
  raise UnsupportedOption
@@ -32,7 +32,7 @@ module Puma
32
32
 
33
33
  def jruby_daemon_start
34
34
  require 'puma/jruby_restart'
35
- JRubyRestart.daemon_start(@restart_dir, restart_args)
35
+ JRubyRestart.daemon_start(@restart_dir, @launcher.restart_args)
36
36
  end
37
37
 
38
38
  def run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-26 00:00:00.000000000 Z
11
+ date: 2016-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc