maintenance_tasks 2.3.1 → 2.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfca7a21544ab46b7d3c24464b29a6ac988dafa08ac8c2f22955d037932e1710
|
4
|
+
data.tar.gz: bdd38b4905fcf1248ca3c88ee8e29e74fb34ca10a226b6bdbd91507d61040250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97f000fad025014bba55992c5d49e1c15557b34599a3a00d7815edf2c9da99aa2a660470ae96c58e89242b515f8e9c588ff9358ae65c5692649cc5f5805cfc10
|
7
|
+
data.tar.gz: aef9399c97ab570a58d5768426d1d2a3e4907b20eaa36dd304f36438a2139c84116358d9e71e63a8098371a3c653f1d1adab94486e6a5ce92508e637cdf62495
|
@@ -41,15 +41,27 @@ module MaintenanceTasks
|
|
41
41
|
task
|
42
42
|
end
|
43
43
|
|
44
|
-
#
|
45
|
-
# superclass.
|
44
|
+
# Loads and returns a list of concrete classes that inherit
|
45
|
+
# from the Task superclass.
|
46
46
|
#
|
47
47
|
# @return [Array<Class>] the list of classes.
|
48
|
-
def
|
48
|
+
def load_all
|
49
49
|
load_constants
|
50
50
|
descendants
|
51
51
|
end
|
52
52
|
|
53
|
+
# Loads and returns a list of concrete classes that inherit
|
54
|
+
# from the Task superclass.
|
55
|
+
#
|
56
|
+
# @return [Array<Class>] the list of classes.
|
57
|
+
def available_tasks
|
58
|
+
warn(<<~MSG.squish, category: :deprecated)
|
59
|
+
MaintenanceTasks::Task.available_tasks is deprecated and will be
|
60
|
+
removed from maintenance-tasks 3.0.0. Use .load_all instead.
|
61
|
+
MSG
|
62
|
+
load_all
|
63
|
+
end
|
64
|
+
|
53
65
|
# Make this Task a task that handles CSV.
|
54
66
|
#
|
55
67
|
# @param in_batches [Integer] optionally, supply a batch size if the CSV
|
@@ -25,7 +25,7 @@ module MaintenanceTasks
|
|
25
25
|
def available_tasks
|
26
26
|
tasks = []
|
27
27
|
|
28
|
-
task_names = Task.
|
28
|
+
task_names = Task.load_all.map(&:name)
|
29
29
|
|
30
30
|
active_runs = Run.with_attached_csv.active.where(task_name: task_names)
|
31
31
|
active_runs.each do |run|
|
@@ -16,15 +16,6 @@ module MaintenanceTasks
|
|
16
16
|
|
17
17
|
desc "perform [TASK NAME]", "Runs the given Maintenance Task"
|
18
18
|
|
19
|
-
long_desc <<-LONGDESC
|
20
|
-
`maintenance_tasks perform` will run the Maintenance Task specified by the
|
21
|
-
[TASK NAME] argument.
|
22
|
-
|
23
|
-
Available Tasks:
|
24
|
-
|
25
|
-
#{MaintenanceTasks::Task.available_tasks.join("\n\n")}
|
26
|
-
LONGDESC
|
27
|
-
|
28
19
|
# Specify the CSV file to process for CSV Tasks
|
29
20
|
desc = "Supply a CSV file to be processed by a CSV Task, "\
|
30
21
|
"--csv path/to/csv/file.csv"
|
@@ -50,6 +41,21 @@ module MaintenanceTasks
|
|
50
41
|
say_status(:error, error.message, :red)
|
51
42
|
end
|
52
43
|
|
44
|
+
# `long_desc` only allows us to use a static string as "long description".
|
45
|
+
# By redefining the `#long_description` method on the "perform" Command
|
46
|
+
# object instead, we make it dynamic, thus delaying the task loading
|
47
|
+
# process until it's actually required.
|
48
|
+
commands["perform"].define_singleton_method(:long_description) do
|
49
|
+
<<~LONGDESC
|
50
|
+
`maintenance_tasks perform` will run the Maintenance Task specified by
|
51
|
+
the [TASK NAME] argument.
|
52
|
+
|
53
|
+
Available Tasks:
|
54
|
+
|
55
|
+
#{Task.load_all.map(&:name).sort.join("\n\n")}
|
56
|
+
LONGDESC
|
57
|
+
end
|
58
|
+
|
53
59
|
private
|
54
60
|
|
55
61
|
def csv_file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maintenance_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -56,14 +56,14 @@ dependencies:
|
|
56
56
|
name: job-iteration
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.3.6
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.3.6
|
69
69
|
- !ruby/object:Gem::Dependency
|
@@ -156,7 +156,7 @@ homepage: https://github.com/Shopify/maintenance_tasks
|
|
156
156
|
licenses:
|
157
157
|
- MIT
|
158
158
|
metadata:
|
159
|
-
source_code_uri: https://github.com/Shopify/maintenance_tasks/tree/v2.3.
|
159
|
+
source_code_uri: https://github.com/Shopify/maintenance_tasks/tree/v2.3.2
|
160
160
|
allowed_push_host: https://rubygems.org
|
161
161
|
post_install_message:
|
162
162
|
rdoc_options: []
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.4.
|
176
|
+
rubygems_version: 3.4.19
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: A Rails engine for queuing and managing maintenance tasks
|