sidekiq_adhoc_job 2.2.0 → 2.2.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96ab7b918f79f69babbe8ef14bc9d697b9f14c9ea0ede25ee3af10b5a10068f6
|
|
4
|
+
data.tar.gz: '069bb2cce767dbfd9a9dcd08db9e8e56a3da12c6bb786d42dc843d5e12a77019'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03c23e8eff7b09ec21fba9009f64fd98a74005b82a789ef143d87878b4283441d90667d9674004c085e02e297e3e6b64f964b4f0bd7b2a8ccfe6535a05cdafae
|
|
7
|
+
data.tar.gz: cd7c6c9dc6cd04664738b3c7b445fc6cb9d2038f5d7523a05f9c223edccd06fabf63db42060dcbf5b0de2b1e704bddf9bb5399e06aca6128d0cbacd6d1025847
|
|
@@ -12,7 +12,8 @@ module SidekiqAdhocJob
|
|
|
12
12
|
:required_kw_args,
|
|
13
13
|
:optional_kw_args,
|
|
14
14
|
:has_rest_args,
|
|
15
|
-
:require_confirm
|
|
15
|
+
:require_confirm,
|
|
16
|
+
:confirm_prompt_message
|
|
16
17
|
|
|
17
18
|
StringUtil ||= ::SidekiqAdhocJob::Utils::String
|
|
18
19
|
|
|
@@ -27,6 +28,7 @@ module SidekiqAdhocJob
|
|
|
27
28
|
@optional_kw_args = args[:key] || []
|
|
28
29
|
@has_rest_args = !!args[:rest]
|
|
29
30
|
@require_confirm = require_confirm
|
|
31
|
+
@confirm_prompt_message = SidekiqAdhocJob.config.require_confirm_prompt_message
|
|
30
32
|
end
|
|
31
33
|
|
|
32
34
|
# Builds the presenter instances for the schedule hash
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
<% if @presented_job.require_confirm %>
|
|
60
60
|
<script>
|
|
61
61
|
document.getElementById('adhoc-jobs-submit-form').addEventListener('submit', (event) => {
|
|
62
|
-
|
|
62
|
+
const confirmPrompt = "<%= @presented_job.confirm_prompt_message %>";
|
|
63
|
+
if (prompt(`Please enter "${confirmPrompt}" to confirm`) !== confirmPrompt)
|
|
63
64
|
event.preventDefault();
|
|
64
65
|
})
|
|
65
66
|
</script>
|
data/lib/sidekiq_adhoc_job.rb
CHANGED
|
@@ -46,10 +46,13 @@ module SidekiqAdhocJob
|
|
|
46
46
|
:strategy_name,
|
|
47
47
|
:require_confirm_worker_names
|
|
48
48
|
|
|
49
|
+
attr_reader :require_confirm_prompt_message
|
|
50
|
+
|
|
49
51
|
def initialize
|
|
50
52
|
@load_paths = []
|
|
51
53
|
@module_names = []
|
|
52
54
|
@strategy_name = :default
|
|
55
|
+
@require_confirm_prompt_message = 'confirm'
|
|
53
56
|
end
|
|
54
57
|
|
|
55
58
|
def module_names
|
|
@@ -60,6 +63,12 @@ module SidekiqAdhocJob
|
|
|
60
63
|
@require_confirm ||= Array(@require_confirm_worker_names).map(&:to_s)
|
|
61
64
|
end
|
|
62
65
|
|
|
66
|
+
def require_confirm_prompt_message=(message)
|
|
67
|
+
raise 'require_confirm_prompt_message must be string' unless message.is_a? String
|
|
68
|
+
|
|
69
|
+
@require_confirm_prompt_message = message
|
|
70
|
+
end
|
|
71
|
+
|
|
63
72
|
def require_confirmation?(worker_name)
|
|
64
73
|
require_confirm.include?(worker_name)
|
|
65
74
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sidekiq_adhoc_job
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Goh Khoon Hiang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pry
|