dalliance 0.3.4 → 0.4.0

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
  SHA1:
3
- metadata.gz: 267405e920c6dfe198292f8ae05498c00494b34b
4
- data.tar.gz: ad7ffd0ee48511a8121a68def129eb8ac8ccb6f9
3
+ metadata.gz: d31a75c5a62922080b8fe3c78d8ca1f4269370ae
4
+ data.tar.gz: ca8db2678a622de8635ce8b1c3f98071e207a6b9
5
5
  SHA512:
6
- metadata.gz: 67b7ba61c97d54b59a5c11b83fee1e735ff43ac1b6c8f5998f6f102395eee408a099a05a66ea3c4aed7d871fd7ed4a24492efd9155abd5464afe65b109d54f46
7
- data.tar.gz: a331099ddaf02e82c158ff928ad8a4a3cbf8ebd5aa19ea2aaa98593dc80574f6e6977bcd0b51bea715c75a3c4a9d70b26f35615deb2a798bf1e4804c6d2040ab
6
+ metadata.gz: 1193c409c957dde6d9c4fb4d65cd5cc9774fc8450eff1eab6f38791746e13d67f4bd40798e3c3c87ac9f4b3533b4fc013a2c816df6593a3039208e34a2cebd4d
7
+ data.tar.gz: 78fc6807ba76c33748fcdc976edc66482caf33c89cd5a61f590c075918b1cede37f33d4d5188a7dfdfa2682bdeebd2e75adf704b9531674ad4de4466618b5cc6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- dalliance (0.3.4)
4
+ dalliance (0.4.0)
5
5
  rails (>= 3.2, < 5.0)
6
6
  state_machine
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- dalliance (0.3.4)
4
+ dalliance (0.4.0)
5
5
  rails (>= 3.2, < 5.0)
6
6
  state_machine
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- dalliance (0.3.4)
4
+ dalliance (0.4.0)
5
5
  rails (>= 3.2, < 5.0)
6
6
  state_machine
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- dalliance (0.3.4)
4
+ dalliance (0.4.0)
5
5
  rails (>= 3.2, < 5.0)
6
6
  state_machine
7
7
 
@@ -201,10 +201,18 @@ module Dalliance
201
201
  pending? || processing?
202
202
  end
203
203
 
204
+ def processing_queue
205
+ if self.class.dalliance_options[:queue].respond_to?(:call)
206
+ self.class.instance_exec self, &dalliance_options[:queue]
207
+ else
208
+ self.class.dalliance_options[:queue]
209
+ end
210
+ end
211
+
204
212
  #Force backgound_processing w/ true
205
213
  def dalliance_background_process(backgound_processing = nil)
206
214
  if backgound_processing || (backgound_processing.nil? && self.class.dalliance_options[:background_processing])
207
- self.class.dalliance_options[:worker_class].enqueue(self, self.class.dalliance_options[:queue])
215
+ self.class.dalliance_options[:worker_class].enqueue(self, processing_queue)
208
216
  else
209
217
  dalliance_process(false)
210
218
  end
@@ -1,8 +1,8 @@
1
1
  module Dalliance
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 3
5
- TINY = 4
4
+ MINOR = 4
5
+ TINY = 0
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -24,4 +24,30 @@ RSpec.describe 'Dalliance' do
24
24
  expect(DallianceModel.human_attribute_name(:dalliance_status)).to eq ('Status')
25
25
  end
26
26
  end
27
+
28
+ context "processing_queue" do
29
+ before do
30
+ DallianceModel.dalliance_options[:queue] = queue
31
+ end
32
+
33
+ context "string" do
34
+ let(:queue) { 'dalliance_2'}
35
+
36
+ specify{ expect(subject.processing_queue).to eq(queue) }
37
+ end
38
+
39
+ context "proc" do
40
+ context "w/o args" do
41
+ let(:queue) { Proc.new{ 'dalliance_2' } }
42
+
43
+ specify{ expect(subject.processing_queue).to eq(queue.call) }
44
+ end
45
+
46
+ context "w/ args" do
47
+ let(:queue) { Proc.new{ |a,b,c| 'dalliance_2' } }
48
+
49
+ specify{ expect(subject.processing_queue).to eq(queue.call) }
50
+ end
51
+ end
52
+ end
27
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalliance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Sullivan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2018-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  requirements: []
181
181
  rubyforge_project: dalliance
182
- rubygems_version: 2.4.5.1
182
+ rubygems_version: 2.6.14
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: Wrapper for an ActiveRecord model with a single ascynhronous method