tomo 1.22.0 → 1.22.1

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: 37bdfaccc033913ce90f1f6efe579494272950799a735339e5f1ef17c4d10ce1
4
- data.tar.gz: e88924edaee4847ca1656dfe0381c275ef04d9d0f8ecd09499a5b98e0c71c211
3
+ metadata.gz: 5ab6df6968dd42a95ca984a38b14a817c0d0a947454441d844515fdc0dae5f8b
4
+ data.tar.gz: 02acf3183ca8fd770437d67a33efa21fe32b56af223d6b0c281b89a549b3fc97
5
5
  SHA512:
6
- metadata.gz: 3ef5995f18228bb9c1631d89f88bbd63258f193c51a3ce40d506b5d56e4d9b4f2c5d030eef211db57ca81d57d4350f360e94ffb8979e00105c42ad8a644cfa7f
7
- data.tar.gz: '08eac8929502a70fdb7c4696b875a3ab58cd25783990bb5d2bcff124aff251b59330394063a8c0277dc28b937e1a270f96107e6169efd5824609b9af7a798f21'
6
+ metadata.gz: 9328f7bcc5b49da0af09bec1a1cb03bbbef8a47b7fd31e2105005ab644ac4fcf93f17b432041a6ae158f45393adb881627ef0d8a4b218df818a6d945611bae0c
7
+ data.tar.gz: f9d299f3fca94e68d67e8a44e669a0e24ce84b9c8afcb1f9615ac272dfee1c9a93d53f352c3e1535ffb749a9cbca6f0b6786861b03a29a0f911544e62b8ae59d
data/lib/tomo/error.rb CHANGED
@@ -6,7 +6,7 @@ module Tomo
6
6
 
7
7
  include Colors
8
8
 
9
- def self.raise_with(message=nil, attributes)
9
+ def self.raise_with(message=nil, attributes) # rubocop:disable Style/OptionalArguments
10
10
  err = new(message)
11
11
  attributes.each { |attr, value| err.public_send(:"#{attr}=", value) }
12
12
  raise err
@@ -4,6 +4,9 @@ module Tomo::Plugin::Puma
4
4
  class Tasks < Tomo::TaskLibrary
5
5
  SystemdUnit = Struct.new(:name, :template, :path)
6
6
 
7
+ # Exposed to allow override during unit tests
8
+ def self.polling_delay = 1
9
+
7
10
  def setup_systemd # rubocop:disable Metrics/AbcSize
8
11
  linger_must_be_enabled!
9
12
 
@@ -90,7 +93,7 @@ module Tomo::Plugin::Puma
90
93
  def wait_until
91
94
  timeout = settings[:puma_check_timeout].to_i
92
95
  start = Time.now.to_i
93
- delay = 1
96
+ delay = self.class.polling_delay
94
97
 
95
98
  loop do
96
99
  sleep delay
@@ -99,7 +102,7 @@ module Tomo::Plugin::Puma
99
102
  elapsed = Time.now.to_i - start
100
103
  return false if elapsed >= timeout
101
104
 
102
- delay = [delay + 1, timeout - elapsed].min
105
+ delay = [delay + self.class.polling_delay, timeout - elapsed].min
103
106
  end
104
107
  end
105
108
 
@@ -26,7 +26,7 @@ module Tomo
26
26
 
27
27
  case applicable_hosts.length
28
28
  when 1 then applicable_hosts.first.to_s
29
- when 2 then applicable_hosts.map(&:to_s).join(" and ")
29
+ when 2 then applicable_hosts.join(" and ")
30
30
  else
31
31
  "#{applicable_hosts.first} and #{applicable_hosts.length - 1} other hosts"
32
32
  end
@@ -120,7 +120,7 @@ class Unit
120
120
  end
121
121
  end
122
122
 
123
- class Service < Unit
123
+ class Service < Unit # rubocop:disable Style/OneClassPerFile
124
124
  def is_active # rubocop:disable Naming/PredicatePrefix
125
125
  exit(false) unless started?
126
126
  puts "active"
@@ -176,8 +176,8 @@ class Service < Unit
176
176
  end
177
177
 
178
178
  def with_detached_io
179
- null_in = File.open(File::NULL, "r")
180
- null_out = File.open(File::NULL, "w")
179
+ null_in = File.open(File::NULL, "r") # rubocop:disable Style/FileOpen
180
+ null_out = File.open(File::NULL, "w") # rubocop:disable Style/FileOpen
181
181
  $stdin.reopen(null_in)
182
182
  $stderr.reopen(null_out)
183
183
  $stdout.reopen(null_out)
data/lib/tomo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tomo
4
- VERSION = "1.22.0"
4
+ VERSION = "1.22.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.0
4
+ version: 1.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  - !ruby/object:Gem::Version
189
189
  version: '0'
190
190
  requirements: []
191
- rubygems_version: 4.0.6
191
+ rubygems_version: 4.0.17
192
192
  specification_version: 4
193
193
  summary: A friendly CLI for deploying Rails apps ✨
194
194
  test_files: []