acidic_job 1.0.0.beta.7 → 1.0.0.beta.8

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: 2ffcde3bd4dedc0b59de934bed0cadeaa63f33fb26f36ddf1678d17e0abbec55
4
- data.tar.gz: 8fe70548a2e2438e59956a41b2373f294150716a2d5e2de7e84993aeb766a523
3
+ metadata.gz: 81769867ab7962af7062bc8714523d8743a629b3e13eb71f6f5561024bfe795c
4
+ data.tar.gz: bc8ca04208ed63b2a70839490a44102868238df48740a19f7a1d08d19115b29b
5
5
  SHA512:
6
- metadata.gz: fcd0acb3acda0eeaaf499a58c165e376739d808d50f074e35f6236f5b0acdb55b34296b95f86a5edabb19b5c6c3e0e24a04e3408e62322052f43f538bcbc2433
7
- data.tar.gz: 46e5c1560717f18399afad20f568a69b8ee2c66aff02ba03f54d04f74dc2e749ad3aa5e5f73e470e22cb3a0737ac9f394498db558d4d806f7f453fb501b272f9
6
+ metadata.gz: f9cc54a6e0956fed6fb57babdca80a95126810dae84d244abbd162e428bb52bb7cc59ccf34e2f5a9fea29ac7ea719919bd2c8f6fbe026e167947a69aae794be3
7
+ data.tar.gz: eefa772f9f26643ba39048f6d61b460a08b55c635386803df62e476edf3b00c77000380b0b3bf94fbe00b4d11ece3cdd764f07d97ab656e6aa54e41097f7df47
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acidic_job (1.0.0.beta.7)
4
+ acidic_job (1.0.0.beta.8)
5
5
  activejob
6
6
  activerecord
7
7
  activesupport
@@ -227,7 +227,7 @@ module AcidicJob
227
227
 
228
228
  # "STG__#{idempotency_key}__#{encoded_global_id}"
229
229
  _prefix, _idempotency_key, encoded_global_id = job_id.split("__")
230
- staged_job_gid = "gid://#{::Base64.decode64(encoded_global_id)}"
230
+ staged_job_gid = "gid://#{::Base64.urlsafe_decode64(encoded_global_id)}"
231
231
 
232
232
  @staged_job_run = ::GlobalID::Locator.locate(staged_job_gid)
233
233
  end
@@ -19,7 +19,7 @@ module AcidicJob
19
19
  if !@run.known_recovery_point?
20
20
  raise UnknownRecoveryPoint,
21
21
  "Defined workflow does not reference this step: #{@run.current_step_name.inspect}"
22
- elsif Array(awaited_jobs = jobs_from(@run.current_step_awaits)).compact.any?
22
+ elsif (awaited_jobs = jobs_from(@run.current_step_awaits)).any?
23
23
  # We only execute the current step, without progressing to the next step.
24
24
  # This ensures that any failures in parallel jobs will have this step retried in the main workflow
25
25
  step_result = @workflow.execute_current_step
@@ -65,10 +65,11 @@ module AcidicJob
65
65
  def jobs_from(jobs_or_jobs_getter)
66
66
  case jobs_or_jobs_getter
67
67
  when Array
68
- jobs_or_jobs_getter
68
+ jobs_or_jobs_getter.compact
69
69
  when Symbol, String
70
70
  if @job.respond_to?(jobs_or_jobs_getter, _include_private = true)
71
- @job.method(jobs_or_jobs_getter).call
71
+ jobs = @job.method(jobs_or_jobs_getter).call
72
+ Array(jobs).compact
72
73
  else
73
74
  raise UnknownAwaitedJob,
74
75
  "Invalid `awaits`; unknown method `#{jobs_or_jobs_getter}` for this job"
@@ -130,7 +130,7 @@ module AcidicJob
130
130
  # encode the identifier for this record in the job ID
131
131
  global_id = to_global_id.to_s.remove("gid://")
132
132
  # base64 encoding for minimal security
133
- encoded_global_id = Base64.encode64(global_id).strip
133
+ encoded_global_id = Base64.urlsafe_encode64(global_id, padding: false)
134
134
 
135
135
  [
136
136
  STAGED_JOB_ID_PREFIX,
@@ -174,7 +174,7 @@ module AcidicJob
174
174
  end
175
175
 
176
176
  def current_step_awaits
177
- current_step_hash.fetch("awaits", []) || []
177
+ current_step_hash["awaits"]
178
178
  end
179
179
 
180
180
  def next_step_finishes?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AcidicJob
4
- VERSION = "1.0.0.beta.7"
4
+ VERSION = "1.0.0.beta.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acidic_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.7
4
+ version: 1.0.0.beta.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - fractaledmind