jobba 1.7.0 → 1.8.0

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
- SHA1:
3
- metadata.gz: 8b6fbe4f79c7707c269facfeb60eddd1af3f6983
4
- data.tar.gz: 0d2910f8859ea8d05a1745a3cc58bbaf0ff34a2b
2
+ SHA256:
3
+ metadata.gz: 937d8738afd80bda5878ea1dad5d82310d5d4090c5de83788c0f427816328180
4
+ data.tar.gz: 1a23bbcc448af7634b683fe743fd8cc59a4b3cecd06575a7e076eb473caa5a0a
5
5
  SHA512:
6
- metadata.gz: 6091608aa497bc8027fa30c23dbecf31c6d9d2e987177da8fed93cda20629ca35a26b3b806664a5e7983a45d4612ff5020857ab5752de11d66f059be81eadbb5
7
- data.tar.gz: c81bb3aebf41dab11f2c94b37f6915d2ad4ead35586e78df8bea825427406ac128d531ea8c15a863258c2fefd70f24dbd5d00ae0d546a5e92b55a4f85ba34f6d
6
+ metadata.gz: df3b9f488b84af546a31e5931abc4e67b9641324687c6c6272ce90cb0b3b2aaa3a2480ceb448aac485cda2e656d090d3a607b776891f65ba9f2c68fb87f3e196
7
+ data.tar.gz: 0cad4eb0d5c6016fba344849815ff0ec09236ce6cee8e8e52522db946442c4067553a867f301f1b6d92f2ca3fc575fb146cdf831e0b7d2f602062d3b69f0a72a
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.5.3
@@ -2,6 +2,10 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.2.3
5
+ - 2.3.8
6
+ - 2.4.5
7
+ - 2.5.3
8
+ - 2.6.0
5
9
  cache: bundler
6
10
  bundler_args: --retry=6
7
11
  script:
@@ -13,3 +17,5 @@ notifications:
13
17
  env:
14
18
  - USE_REAL_REDIS=false
15
19
  - USE_REAL_REDIS=true
20
+ before_install:
21
+ - gem install bundler -v '< 2'
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_runtime_dependency "redis", "~> 3.2"
23
+ spec.add_runtime_dependency "oj", '~> 3.7.6'
23
24
  spec.add_runtime_dependency "redis-namespace"
24
25
 
25
26
  spec.add_development_dependency "bundler", "~> 1.10"
@@ -59,11 +59,6 @@ class Jobba::State
59
59
  ALL_TIMESTAMP_SYMBOLS = ALL.collect{|state| state.timestamp_name_key}.freeze
60
60
 
61
61
  def to_json
62
- name.to_json
62
+ "\"#{name}\""
63
63
  end
64
64
  end
65
-
66
-
67
-
68
-
69
-
@@ -1,5 +1,5 @@
1
- require 'json'
2
1
  require 'ostruct'
2
+ require 'oj'
3
3
 
4
4
  module Jobba
5
5
  class Status
@@ -163,7 +163,11 @@ module Jobba
163
163
  end
164
164
 
165
165
  def normalize_for_json(input)
166
- JSON.parse(input.to_json, quirks_mode: true)
166
+ Oj.load(convert_to_json(input))
167
+ end
168
+
169
+ def convert_to_json(value)
170
+ Oj.dump(value, mode: :custom, use_to_json: true)
167
171
  end
168
172
 
169
173
  def delete
@@ -219,7 +223,7 @@ module Jobba
219
223
  def archive_attempt!
220
224
  archived_job_key = job_key(attempt)
221
225
  redis.rename(job_key, archived_job_key)
222
- redis.hset(archived_job_key, :id, "#{id}:#{attempt}".to_json)
226
+ redis.hset(archived_job_key, :id, convert_to_json("#{id}:#{attempt}"))
223
227
  delete_locally!
224
228
  end
225
229
 
@@ -260,7 +264,7 @@ module Jobba
260
264
 
261
265
  def load_from_json_encoded_attrs(attribute_name)
262
266
  json = (@json_encoded_attrs || {})[attribute_name]
263
- attribute = json.nil? ? nil : JSON.parse(json, quirks_mode: true)
267
+ attribute = json.nil? ? nil : Oj.load(json)
264
268
 
265
269
  case attribute_name
266
270
  when 'state'
@@ -298,8 +302,7 @@ module Jobba
298
302
  key = kv_array[0]
299
303
  value = kv_array[1]
300
304
  value = Jobba::Utils.time_to_usec_int(value) if value.is_a?(::Time)
301
-
302
- [key, value.to_json]
305
+ [key, convert_to_json(value)]
303
306
  end
304
307
 
305
308
  Jobba.redis.hmset(job_key, *redis_key_value_array)
@@ -1,3 +1,3 @@
1
1
  module Jobba
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Slavinsky
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-10 00:00:00.000000000 Z
11
+ date: 2019-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: oj
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.7.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.7.6
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: redis-namespace
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -161,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
175
  - !ruby/object:Gem::Version
162
176
  version: '0'
163
177
  requirements: []
164
- rubyforge_project:
165
- rubygems_version: 2.4.5.1
178
+ rubygems_version: 3.0.2
166
179
  signing_key:
167
180
  specification_version: 4
168
181
  summary: Redis-based background job status tracking.