switchman 1.13.1 → 1.13.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0da8765009599e793ec49667263b811a6a753c9a82183fffb45fb29e04e75f3c
4
- data.tar.gz: '0904d12fa61d697f510eaed32a23e91d76a7d59148e903d8a3a39cccc984e41d'
3
+ metadata.gz: 0f0444c8114ea5df8627ea4124a5c99c0aafd64840493f6e410fade341bedb24
4
+ data.tar.gz: 44176439003933f030ba0eac73b46dbe7aa6a9a9712c4a9359027d20c7948296
5
5
  SHA512:
6
- metadata.gz: d537cf1457720439c8fbccaee08a31ffee886efe47aa0d54133e83a889d233becf4dd6c538eb64c7a0e45656574c06bdea6e31572d969489fea65d27da0e7d40
7
- data.tar.gz: aa3d6e6960ee1a8b54c492a1541a9372313249e6a5800e7e2f92888d1249e5ed87f5a28afa0b0c9f9e6dcc7aa61eb969f233778d154ef97e5cd6752815dd23cc
6
+ metadata.gz: 2771dd0ecf117e53a327a9c9092b6efca169fc9dfadc63efc486d401c00646eda3e2a819d3a783ac2be4cd971929366f2c6187fffe5b48f8f674c6cc94eea333
7
+ data.tar.gz: a2eaae7a569c79abdd0658390d28d3272767d586a78c3bf19bf616eeaefe65ca774d0d6d5ff49a4241cfc7149f274881f42da5dd6d791fb98c9aa97a98af463c
@@ -254,7 +254,21 @@ module Switchman
254
254
  pid, io_in, io_out, io_err = Open4.pfork4(lambda do
255
255
  begin
256
256
  Switchman.config[:on_fork_proc]&.call
257
- $0 = [$0, ARGV, name].flatten.join(' ')
257
+
258
+ # set a pretty name for the process title, up to 128 characters
259
+ # (we don't actually know the limit, depending on how the process
260
+ # was started)
261
+ # first, simplify the binary name by stripping directories,
262
+ # then truncate arguments as necessary
263
+ bin = File.basename(Process.argv0)
264
+ max_length = 128 - bin.length - name.length - 3
265
+ args = ARGV.join(" ")
266
+ if max_length >= 0
267
+ args = args[0..max_length]
268
+ end
269
+ new_title = [bin, args, name].join(" ")
270
+ Process.setproctitle(new_title)
271
+
258
272
  with_each_shard(subscope, categories, options) { yield }
259
273
  exception_pipe.last.close
260
274
  rescue => e
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.13.1"
2
+ VERSION = "1.13.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.1
4
+ version: 1.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-04-05 00:00:00.000000000 Z
13
+ date: 2019-04-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties