operationable 0.5.1 → 0.5.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: c411980798c3f46780a091735a264b1647f16462d08bb76d2a97210890687610
4
- data.tar.gz: 74cccd3d65e1a28d7c993566e75cd2d018056e86abd19c927ef5fdeaa248be4e
3
+ metadata.gz: 1fd652ffb16ec0bcfaf2a3afef7da617184d1c1342783a7e91ba44bd513dcead
4
+ data.tar.gz: 2ba2915b2033ec83dab017811fd0d9beba622be4b91059950c4cb437bb1fb02b
5
5
  SHA512:
6
- metadata.gz: f7a914e63e5ba714db548822154b8cb972290959f15041cf357fa4d0ac1c7a171fde9eb061eb71c3d054ac84c06911e363b0619c100dca6a1210199cd12e3ceb
7
- data.tar.gz: 9da8dbac6b7f277ed3c80b15b51bdb7b63d7a6ccf1658e3d40cbea5a2c6f554226eb08b9af71733c2e841cd8be3171386db2a5180379f0ed48fcf54064288e3b
6
+ metadata.gz: 2cf672c4097d5fe242f088064d6d74554f1528dada888f8252ef885b9894cba123f82c6fa7fb234e302542a3edf1caed6e48c5bdee5f86a9b6722f3714764138
7
+ data.tar.gz: f8456636c1a3d29ed7daee13ff0b1f2a22f52b2da923c68811badc5e96563567445ae84d7db20257d502a8db4c4858e0886bc298a45ae0a30cbcd0415902d96a
@@ -116,6 +116,10 @@ module Operationable
116
116
  sync? ? job_sync_execute_method : job_async_execute_method
117
117
  end
118
118
 
119
+ def perform(job_class_name, args)
120
+ job_class_name.to_s.constantize.method(perform_method).call(args)
121
+ end
122
+
119
123
  def sync?
120
124
  %w(test development).include? Rails.env
121
125
  end
@@ -10,10 +10,12 @@ module Operationable
10
10
  # callback can be class
11
11
  # callback_class = callback_method_name.to_s.safe_constantize
12
12
 
13
- (queue.blank? ? self.class : job_class_name.constantize.method(perform_method)).call(
13
+ args = {
14
14
  q_options: q_options(callback_method_name, queue),
15
15
  props: props.merge(params)
16
- )
16
+ }
17
+
18
+ queue.blank? ? self.class.call(args) : perform(job_class_name, args)
17
19
  end
18
20
 
19
21
  def q_options(callback_method_name, queue)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ # TODO: never used, may be remove
2
3
  module Operationable
3
4
  module Runners
4
5
  class Serial < ::Operationable::Runners::Base
@@ -7,7 +8,7 @@ module Operationable
7
8
  end
8
9
 
9
10
  def process
10
- (queue.blank? ? self.class : job_class.to_s.constantize.method(perform_method)).call(
11
+ (queue.blank? ? self.class : perform(job_class_name)).call(
11
12
  q_options: q_options,
12
13
  props: props
13
14
  )
@@ -1,3 +1,3 @@
1
1
  module Operationable
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: operationable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Suhodolov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-01 00:00:00.000000000 Z
12
+ date: 2020-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activejob