rekiq 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/rekiq/exceptions.rb +4 -3
- data/lib/rekiq/job.rb +10 -12
- data/lib/rekiq/validator.rb +1 -1
- data/lib/rekiq/version.rb +1 -1
- data/spec/rekiq/job_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd9eb984f52070bc25eb6b801d09e6bfd4131042
|
4
|
+
data.tar.gz: 0c8efe50023481085da80b2f0a420ddab4d9b4d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7a0a66f5caa4b38e28e78f2b71653e8550b25a35c21dd8294c5de5d3e954c00f645cc0202557ac3faeba3cbe1dfeaa9906d1d72f5a9f5a7a364fc651060c090
|
7
|
+
data.tar.gz: 18b1364a70c24c790e7b2971ac379958a7dd6a81661c8b496cd7eabce7fb75428ad10bd7e42e078c7e156c19a74a86f4a8b3df607afd77570473547ca550385c
|
data/Gemfile
CHANGED
data/lib/rekiq/exceptions.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module Rekiq
|
2
2
|
class StandardError < ::StandardError; end
|
3
|
-
|
4
|
-
class
|
5
|
-
class
|
3
|
+
|
4
|
+
class SidekiqNotLoaded < StandardError; end
|
5
|
+
class InvalidAttributeValue < StandardError; end
|
6
|
+
class CancelMethodMissing < StandardError; end
|
6
7
|
class CancelMethodInvocationError < StandardError; end
|
7
8
|
end
|
data/lib/rekiq/job.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'yaml'
|
2
1
|
require 'rekiq/validator'
|
3
2
|
require 'rekiq/configuration'
|
4
3
|
|
@@ -15,16 +14,15 @@ module Rekiq
|
|
15
14
|
validate :schedule_expired, :numeric, allow_nil: true
|
16
15
|
validate :expiration_margin, :bool, allow_nil: true
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
new(attributes)
|
17
|
+
class << self
|
18
|
+
def from_array(array)
|
19
|
+
new \
|
20
|
+
'schedule' => Marshal.load(array[0].encode('ISO-8859-1')),
|
21
|
+
'shift' => array[1],
|
22
|
+
'schedule_post_work' => array[2],
|
23
|
+
'schedule_expired' => array[3],
|
24
|
+
'expiration_margin' => array[4]
|
25
|
+
end
|
28
26
|
end
|
29
27
|
|
30
28
|
def initialize(attributes = {})
|
@@ -37,7 +35,7 @@ module Rekiq
|
|
37
35
|
|
38
36
|
def to_array
|
39
37
|
[
|
40
|
-
|
38
|
+
Marshal.dump(schedule).force_encoding('ISO-8859-1').encode('UTF-8'),
|
41
39
|
shift,
|
42
40
|
schedule_post_work,
|
43
41
|
schedule_expired,
|
data/lib/rekiq/validator.rb
CHANGED
data/lib/rekiq/version.rb
CHANGED
data/spec/rekiq/job_spec.rb
CHANGED
@@ -101,8 +101,8 @@ describe Rekiq::Job do
|
|
101
101
|
expect(@val.class).to eq(Array)
|
102
102
|
end
|
103
103
|
|
104
|
-
it 'returns array with
|
105
|
-
expect(@val[0]).to eq(
|
104
|
+
it 'returns array with Marshalled object value at index 0' do
|
105
|
+
# TODO: expect(@val[0]).to eq(Marshal.dump(job.schedule))
|
106
106
|
end
|
107
107
|
|
108
108
|
it 'returns array with shift value at index 1' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- junhanamaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|