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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e970392060bfe3fcb6194631697f85a7f5096de7
4
- data.tar.gz: 25da26330912b4a56a072bc51e8d49370ed787e1
3
+ metadata.gz: dd9eb984f52070bc25eb6b801d09e6bfd4131042
4
+ data.tar.gz: 0c8efe50023481085da80b2f0a420ddab4d9b4d2
5
5
  SHA512:
6
- metadata.gz: 5698cbf78ca139d3309d8d2dc0e44b483257fc853738e780429e64f0988b0af46de60ab2f9f0ed5c8bfb3759f220f724ed19f33d6ee8f145f57537d36f2eecb0
7
- data.tar.gz: 6d471125cdb9dd69871182efe661032b99f567f28c973d3fac2481b435eef009749ae7ed2031a36eb9fde3136c04bd98e92ff51a4106bb8cbad52250aa17cebb
6
+ metadata.gz: b7a0a66f5caa4b38e28e78f2b71653e8550b25a35c21dd8294c5de5d3e954c00f645cc0202557ac3faeba3cbe1dfeaa9906d1d72f5a9f5a7a364fc651060c090
7
+ data.tar.gz: 18b1364a70c24c790e7b2971ac379958a7dd6a81661c8b496cd7eabce7fb75428ad10bd7e42e078c7e156c19a74a86f4a8b3df607afd77570473547ca550385c
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rekiq.gemspec
4
- gemspec
4
+ gemspec
@@ -1,7 +1,8 @@
1
1
  module Rekiq
2
2
  class StandardError < ::StandardError; end
3
- class SidekiqNotLoaded < StandardError; end
4
- class InvalidAttributeValue < StandardError; end
5
- class CancelMethodMissing < StandardError; end
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
- def self.from_array(array)
19
- attributes = {}.tap do |hash|
20
- hash['schedule'] = YAML::load(array[0])
21
- hash['shift'] = array[1]
22
- hash['schedule_post_work'] = array[2]
23
- hash['schedule_expired'] = array[3]
24
- hash['expiration_margin'] = array[4]
25
- end
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
- YAML::dump(schedule),
38
+ Marshal.dump(schedule).force_encoding('ISO-8859-1').encode('UTF-8'),
41
39
  shift,
42
40
  schedule_post_work,
43
41
  schedule_expired,
@@ -47,7 +47,7 @@ module Rekiq
47
47
  if NUMERIC_OPTIONS.key?(key) and
48
48
  !value.send(NUMERIC_OPTIONS[key], option_value)
49
49
  raise InvalidAttributeValue, "#{attribute_name} must be greater " \
50
- 'or equal to 0'
50
+ "or equal to #{option_value}"
51
51
  end
52
52
  end
53
53
  end
data/lib/rekiq/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rekiq
2
- VERSION = "0.9.2"
2
+ VERSION = '0.9.3'
3
3
  end
@@ -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 YAML::dump(schedule) value at index 0' do
105
- expect(@val[0]).to eq(YAML::dump(job.schedule))
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.2
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-08-22 00:00:00.000000000 Z
11
+ date: 2014-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler