good_job 4.6.0 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e6676f189c0e22c751837d8792b84ece28dfcc118941077abfcdfac7e352c18
4
- data.tar.gz: 891e630829ec28fb022d516e50d5d9c61e51dc81531ce3f20c25f2facfee09c6
3
+ metadata.gz: 00f71f047b33832b758797f8fb9c7987a13eae1abb1750467dcbbab12c7680b0
4
+ data.tar.gz: 4a9f501a236f45781904d2468cef99d05cea42ac5d76568d8b72ae437823e3e6
5
5
  SHA512:
6
- metadata.gz: d443d783208de5f01cd003773943199c618f397a46a1ecb5d7e9167a9eaedc0511f9e4b3cec6122c17cd0be328b490230727024041b7622ad1f9f8afcaf817e1
7
- data.tar.gz: fc1171540d6227d0e7757a09904b617791289daeec89c3045251b46e8d82959b9df4b5ecd0b4c812a2804ac7c7626712ebea93d3718984fb08a1592c097db068
6
+ metadata.gz: 575e7338adaaaa661f4f0d219ddbaac20dff3547f9878098d51ab71a54dce5660467d2f45d492dd6fa79496143f6482e170557a7b8a230e25853297c9811eba6
7
+ data.tar.gz: 5bdd469825d81387e4071900576ea664e820c98c74f7d6a710d3d39fc5c750af4db0a63fc4d0e0af9faf5481e73f1b6107b3ff88c77a257c9c49d02dda7667f8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.7.0](https://github.com/bensheldon/good_job/tree/v4.7.0) (2024-12-31)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.6.0...v4.7.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Expose good job labels in dashboard [\#1561](https://github.com/bensheldon/good_job/pull/1561) ([BClark88](https://github.com/BClark88))
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Allow cron configuration `class` value to be a proc [\#1566](https://github.com/bensheldon/good_job/pull/1566) ([bensheldon](https://github.com/bensheldon))
14
+ - Add Ruby 3.4 to CI [\#1565](https://github.com/bensheldon/good_job/pull/1565) ([Earlopain](https://github.com/Earlopain))
15
+
3
16
  ## [v4.6.0](https://github.com/bensheldon/good_job/tree/v4.6.0) (2024-12-12)
4
17
 
5
18
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.5.1...v4.6.0)
@@ -101,8 +101,12 @@ module GoodJob # :nodoc:
101
101
  current_thread.cron_key = key
102
102
  current_thread.cron_at = cron_at
103
103
 
104
- configured_job = job_class.constantize.set(set_value)
105
104
  I18n.with_locale(I18n.default_locale) do
105
+ job_klass = job_class_value
106
+ job_klass = job_klass.constantize if job_klass.is_a?(String)
107
+ next unless job_klass.is_a?(Class)
108
+
109
+ configured_job = job_klass.set(set_value)
106
110
  kwargs_value.present? ? configured_job.perform_later(*args_value, **kwargs_value) : configured_job.perform_later(*args_value)
107
111
  end
108
112
  end
@@ -118,6 +122,7 @@ module GoodJob # :nodoc:
118
122
  set: display_property(set),
119
123
  description: display_property(description),
120
124
  }.tap do |properties|
125
+ properties[:class] = display_property(job_class) if job_class.present?
121
126
  properties[:args] = display_property(args) if args.present?
122
127
  properties[:kwargs] = display_property(kwargs) if kwargs.present?
123
128
  end
@@ -160,6 +165,11 @@ module GoodJob # :nodoc:
160
165
  @_fugit ||= Fugit.parse(cron)
161
166
  end
162
167
 
168
+ def job_class_value
169
+ value = job_class || nil
170
+ value.respond_to?(:call) ? value.call : value
171
+ end
172
+
163
173
  def set_value
164
174
  value = set || {}
165
175
  value.respond_to?(:call) ? value.call : value
@@ -5,6 +5,7 @@
5
5
  <div class="col-4"><%= t("good_job.models.batch.jobs") %></div>
6
6
  <div class="d-none d-lg-block col-lg-1 text-lg-center"><%= t "good_job.models.job.queue" %></div>
7
7
  <div class="d-none d-lg-block col-lg-1 text-lg-end"><%= t "good_job.models.job.priority" %></div>
8
+ <div class="d-none d-lg-block col-lg-1 text-lg-end"><%= t "good_job.models.job.labels" %></div>
8
9
  <div class="d-none d-lg-block col-lg-1 text-lg-end"><%= t "good_job.models.job.attempts" %></div>
9
10
  <div class="col text-end">
10
11
  <%= tag.button type: "button", class: "btn btn-sm text-muted", role: "button",
@@ -33,6 +34,12 @@
33
34
  <div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.job.priority" %></div>
34
35
  <span class="font-monospace fw-bold"><%= job.priority %></span>
35
36
  </div>
37
+ <div class="col-4 col-lg-1 text-lg-end">
38
+ <div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.job.labels" %></div>
39
+ <% job.labels&.each do |label| %>
40
+ <span class="badge rounded-pill bg-secondary font-monospace"><%= label %></span>
41
+ <% end %>
42
+ </div>
36
43
  <div class="col-4 col-lg-1 text-lg-end">
37
44
  <div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.job.attempts" %></div>
38
45
  <% if job.error %>
@@ -35,6 +35,7 @@
35
35
  </div>
36
36
  <div class="d-none d-lg-block col-lg-1 text-lg-center"><%= t "good_job.models.job.queue" %></div>
37
37
  <div class="d-none d-lg-block col-lg-1 text-lg-end"><%= t "good_job.models.job.priority" %></div>
38
+ <div class="d-none d-lg-block col-lg-1 text-lg-end"><%= t "good_job.models.job.labels" %></div>
38
39
  <div class="d-none d-lg-block col-lg-1 text-lg-end"><%= t "good_job.models.job.attempts" %></div>
39
40
  <div class="col text-end">
40
41
  <%= tag.button type: "button", class: "btn btn-sm text-muted", role: "button",
@@ -82,6 +83,12 @@
82
83
  <div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.job.priority" %></div>
83
84
  <%= job.priority %>
84
85
  </div>
86
+ <div class="col-4 col-lg-1 text-wrap text-lg-end">
87
+ <div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.job.labels" %></div>
88
+ <% job.labels&.each do |label| %>
89
+ <span class="badge rounded-pill bg-secondary font-monospace"><%= label %></span>
90
+ <% end %>
91
+ </div>
85
92
  <div class="col-4 col-lg-1 text-lg-end">
86
93
  <div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.job.attempts" %></div>
87
94
  <% if job.error %>
@@ -194,6 +194,7 @@ de:
194
194
  job:
195
195
  arguments: Argumente
196
196
  attempts: Versuche
197
+ labels: Etiketten
197
198
  priority: Priorität
198
199
  queue: Warteschlange
199
200
  number:
@@ -194,6 +194,7 @@ en:
194
194
  job:
195
195
  arguments: Arguments
196
196
  attempts: Attempts
197
+ labels: Labels
197
198
  priority: Priority
198
199
  queue: Queue
199
200
  number:
@@ -194,6 +194,7 @@ es:
194
194
  job:
195
195
  arguments: Argumentos
196
196
  attempts: Intentos
197
+ labels: Etiquetas
197
198
  priority: Prioridad
198
199
  queue: Cola
199
200
  number:
@@ -194,6 +194,7 @@ fr:
194
194
  job:
195
195
  arguments: Paramètres
196
196
  attempts: Tentatives
197
+ labels: Étiquettes
197
198
  priority: Priorité
198
199
  queue: File d'attente
199
200
  number:
@@ -194,6 +194,7 @@ it:
194
194
  job:
195
195
  arguments: Argomenti
196
196
  attempts: Tentativi
197
+ labels: Etichette
197
198
  priority: Priorità
198
199
  queue: Coda
199
200
  number:
@@ -194,6 +194,7 @@ ja:
194
194
  job:
195
195
  arguments: 引数
196
196
  attempts: 試行回数
197
+ labels: ラベル
197
198
  priority: 優先度
198
199
  queue: キュー
199
200
  number:
@@ -194,6 +194,7 @@ ko:
194
194
  job:
195
195
  arguments: 인수
196
196
  attempts: 시도 횟수
197
+ labels: 레이블
197
198
  priority: 우선순위
198
199
  queue: 큐
199
200
  number:
@@ -194,6 +194,7 @@ nl:
194
194
  job:
195
195
  arguments: Argumenten
196
196
  attempts: Pogingen
197
+ labels: Labels
197
198
  priority: Prioriteit
198
199
  queue: Wachtrij
199
200
  number:
@@ -194,6 +194,7 @@ pt-BR:
194
194
  job:
195
195
  arguments: Argumentos
196
196
  attempts: Tentativas
197
+ labels: Rótulos
197
198
  priority: Prioridade
198
199
  queue: Fila
199
200
  number:
@@ -220,6 +220,7 @@ ru:
220
220
  job:
221
221
  arguments: Параметры
222
222
  attempts: Попытки
223
+ labels: Метки
223
224
  priority: Приоритет
224
225
  queue: Очередь исполнения
225
226
  number:
@@ -194,6 +194,7 @@ tr:
194
194
  job:
195
195
  arguments: Argümanlar
196
196
  attempts: Denemeler
197
+ labels: Etiketler
197
198
  priority: Öncelik
198
199
  queue: Kuyruk
199
200
  number:
@@ -220,6 +220,7 @@ uk:
220
220
  job:
221
221
  arguments: Аргументи
222
222
  attempts: Спроби
223
+ labels: Мітки
223
224
  priority: Пріоритет
224
225
  queue: Черга
225
226
  number:
@@ -2,7 +2,7 @@
2
2
 
3
3
  module GoodJob
4
4
  # GoodJob gem version.
5
- VERSION = '4.6.0'
5
+ VERSION = '4.7.0'
6
6
 
7
7
  # GoodJob version as Gem::Version object
8
8
  GEM_VERSION = Gem::Version.new(VERSION)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-12 00:00:00.000000000 Z
11
+ date: 2024-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob