puma-redeploy 0.4.1 → 0.4.3

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: e169bb626da9c5e902dcab601274ff12463346bfb8eea5efc7bafa2950e96cac
4
- data.tar.gz: 6a15c8d7a7f403ab49b633f5ce9d96dd23e61eb1f1d3327ccee2241097e60578
3
+ metadata.gz: 85bcaa8e7aa5f21015a2bc251b74e997282cec708b3dad7f8fd7a535afa01861
4
+ data.tar.gz: 62bc2f26c1761301ef0369d02bb8e7df5e5f756ac66a6b152b57bec8edd7bdfa
5
5
  SHA512:
6
- metadata.gz: 34992846409fff5f842402b533de687ac523defaef84c687257d6894cd24ec80727181f23ca82fd96f34d5823b4f41049c32be0ee74a0bbb8b2c716b4b277b40
7
- data.tar.gz: 66f1bf3e0cb9a754bb7e8e5fe3e11f6aee146df3ab725385260b1a08e59dc6f9b74ff3feb266418a712c7e71b79f83a3b61d8bd8a574f5b1b017ff00ae959519
6
+ metadata.gz: '026328f064b8d9589902e5236eda5c030a3ab7f0abc12196ceb2a4b684ec44e172927ec8bfd3c739e9810e5c01e2cfa472be60c8b7e6b673a789578a962d08b6'
7
+ data.tar.gz: 5a350ec550b53b9a45cca883dfea0a9da792e076cc70d11573e28f4a115f04bcad00a1e9d9e4178624df5b5bf96357b223e8136f2ea6715011026502ee397a10
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.4.3
4
+
5
+ **Features:**
6
+
7
+ - Add DSL option to specify the puma restart method type
8
+
9
+ ## v0.4.2
10
+
11
+ **Fixes:**
12
+
13
+ - Fix issue when when unzip status is nil
14
+
3
15
  ## v0.4.1
4
16
 
5
17
  **Fixes:**
data/README.md CHANGED
@@ -45,6 +45,8 @@ plugin :redeploy
45
45
  # Specify the redeploy watch file from an environment variable. This can a file system location or S3 URL. For example `/app/pkg/watch.me` or `s3://puma-test-app-archives/watch.me`.
46
46
  redeploy_watch_file ENV['WATCH_FILE']
47
47
 
48
+ # Specify the Puma restart method type. This can be :phased_restart or :restart. If not specified defaults to :phased_restart
49
+ redeploy_restart_method :restart
48
50
 
49
51
  # Specify the number of seconds between checking watch file. Defaults to 30.
50
52
  redeploy_watch_delay 15
@@ -16,6 +16,7 @@ Puma::Plugin.create do
16
16
  end
17
17
  end
18
18
  end
19
+
19
20
  def monitor_loop(handler, delay, launcher, logger)
20
21
  loop do
21
22
  sleep delay
@@ -31,6 +32,7 @@ def monitor_loop(handler, delay, launcher, logger)
31
32
 
32
33
  Puma::Redeploy::CommandRunner.new(commands: watch_file_data[:commands], logger:).run
33
34
 
34
- launcher.phased_restart
35
+ restart_method = launcher.options[:restart_method] || :phased_restart
36
+ launcher.send(restart_method)
35
37
  end
36
38
  end
@@ -18,5 +18,12 @@ module Puma
18
18
  def redeploy_logger(logger)
19
19
  @options[:redeploy_logger] = logger
20
20
  end
21
+
22
+ def redeploy_restart_method(restart_method)
23
+ raise "Invalid Puma restart method: #{restart_method}" unless %i[phased_restart
24
+ restart].include?(restart_method.to_sym)
25
+
26
+ @options[:restart_method] = restart_method
27
+ end
21
28
  end
22
29
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puma
4
4
  module Redeploy
5
- VERSION = '0.4.1'
5
+ VERSION = '0.4.3'
6
6
  end
7
7
  end
@@ -18,7 +18,7 @@ module Puma
18
18
  stdout, stderr, status = Open3.capture3("unzip -o -K #{source}")
19
19
  @logger.info "stdout: #{stdout}"
20
20
  @logger.info "stderr: #{stderr}"
21
- @logger.info "status: #{status.exitstatus}"
21
+ @logger.info "status: #{status&.exitstatus}"
22
22
  end
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-redeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tbeauvais
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3