deploy_pin 1.3.7 → 1.3.8

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: 4d5801fe8a830296f5f65c20239b11872f2e0c80cde1934a8ab953946b544ed8
4
- data.tar.gz: 162751453a48bd062984e378a1bfb33825d76bf2b700e6a38324fd60c5f714e8
3
+ metadata.gz: e3d6aa336c010d58ff4462cc64038351fa67432faf2f4dd3e094b12d3c912c9e
4
+ data.tar.gz: a9e8d29ac5e8db0c207f2e40a59f6d77013c98efbf7e9cb38c5b1e1b6840f577
5
5
  SHA512:
6
- metadata.gz: '0189c0b921ed86800c1d4c7a1ce7b89f6af1a06ee8f2ced34de0797a7318fd7a508335bbd28980d01e07fce6c467c5117c781ee5958b23c0e8e1b76b33640591'
7
- data.tar.gz: 1e25f0d9854201ec343414547f3dc720a932cf92053c245c878095480622ac36d8fdb42ed77d6a4bce10348960595742dcc189ba2f8500eeec94073e07f773bf
6
+ metadata.gz: bf2efc8fd1cc48f8e1bf5568bb11544d6a20510e7bbfa2ae81f63f831da6776945b6dc22e5d9befa444c77d042b3d6a9a87bb9b40f246c4a54e9801fd960069a
7
+ data.tar.gz: 1527b98cccfec97dad84286cea3063c9a76a051f9286a8be01181bb1bd1c6032e94693b57ed1f3cfea7b1286a2849d5fa2e36a0d8e7a1fe90f41dba946212c63
data/README.md CHANGED
@@ -143,7 +143,7 @@ end
143
143
  Check the documentation [here](lib/deploy_pin/parallel_wrapper.rb).
144
144
 
145
145
  ## Formatting
146
- `run_formatter` is used to format the output of a `run` task
146
+ `run_formatter` is used to format the output of a `run` task
147
147
  `list_formatter` is used to format the output of a `list` task
148
148
 
149
149
  A default value must be defined in the deploy_pin initializer. Ex.:
@@ -151,9 +151,9 @@ A default value must be defined in the deploy_pin initializer. Ex.:
151
151
  # config/initializers/deploy_pin.rb
152
152
  DeployPin.setup do
153
153
  run_formatter(
154
- lambda do |index, task_count, task, executable, start, time = nil|
154
+ lambda do |index, task_count, task, executable, start, duration = nil|
155
155
  end_of_msg = if executable
156
- start ? '(Started)' : "(Done in #{time})\n\n"
156
+ start ? '(Started)' : "(Done in #{duration})\n\n"
157
157
  else
158
158
  "(Skipped)\n\n"
159
159
  end
@@ -3,8 +3,6 @@
3
3
  # executes tasks
4
4
  module DeployPin
5
5
  class Collector
6
- include ActionView::Helpers::DateHelper
7
-
8
6
  attr_reader :identifiers, :formatter
9
7
 
10
8
  def initialize(identifiers:)
@@ -22,11 +20,11 @@ module DeployPin
22
20
 
23
21
  # run if executable
24
22
  if executable
25
- time = execution_time do
23
+ duration = execution_duration do
26
24
  run_with_timeout(task) { task.run }
27
25
  end
28
26
 
29
- DeployPin.run_formatter.call(index, _tasks.count, task, executable, false, time)
27
+ DeployPin.run_formatter.call(index, _tasks.count, task, executable, false, duration)
30
28
  end
31
29
 
32
30
  # mark each task as done
@@ -81,12 +79,12 @@ module DeployPin
81
79
  DeployPin::Database.execute_with_timeout(DeployPin.statement_timeout, **{}, &block)
82
80
  end
83
81
 
84
- def execution_time
82
+ def execution_duration
85
83
  start_time = Time.now
86
84
 
87
85
  yield
88
86
 
89
- time_ago_in_words(start_time)
87
+ Time.now - start_time
90
88
  end
91
89
  end
92
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeployPin
4
- VERSION = '1.3.7'
4
+ VERSION = '1.3.8'
5
5
  end
@@ -6,9 +6,9 @@ DeployPin.setup do
6
6
  fallback_group 'II'
7
7
  statement_timeout 10.minutes
8
8
  run_formatter(
9
- lambda do |index, task_count, task, executable, start, time = nil|
9
+ lambda do |index, task_count, task, executable, start, duration = nil|
10
10
  end_of_msg = if executable
11
- start ? '(Started)' : "(Done in #{time})\n\n"
11
+ start ? '(Started)' : "(Done in #{duration})\n\n"
12
12
  else
13
13
  "(Skipped)\n\n"
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy_pin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viktor Sych
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-07 00:00:00.000000000 Z
11
+ date: 2023-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize