rocketjob 3.0.0.rc2 → 3.0.0.rc3

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: 19ad2006dddc959c04abb5299e6cbdbf8601f54b
4
- data.tar.gz: 453df16f28f68ab2ee760d5ebfbaa10241217295
3
+ metadata.gz: aff3241e47cf0cedc53ce4725ff4a88de09ec7f7
4
+ data.tar.gz: f85e5725f92701bba572eca3197b5b9aaecf0f0e
5
5
  SHA512:
6
- metadata.gz: bb828a20755d818fbbecd8170de158485634dd032141100510d6758d81bd4641fb3bda747316265786a0528125e5019d06fa724f3eb26ec2de9892cd7b458d93
7
- data.tar.gz: cf74c8c0f5878d389b4898414a2fc80e74fbae67cf27419d52c6c61493f5b7a7467e26718c504bbeeedd636d4ff7062dc3aef53816d443a95c30af9d3e287810
6
+ metadata.gz: f08117d7e1cb02a7c8d5e9794383ee15490dc7f8dbe54c846050ce092385f8399424b290d2e05467f8ae693b7441986a483bd6c9ea3377b59c61c5e210c40b4a
7
+ data.tar.gz: 5b28a5f4a542afae011394bf986787f5410638bacd7aae2c1487a6ef1d9a2c2e52d5404ceef95871f06ab8ef331881585002827bf4ce184ac9df3cb3983f2858
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module RocketJob #:nodoc
3
- VERSION = '3.0.0.rc2'
3
+ VERSION = '3.0.0.rc3'
4
4
  end
@@ -41,11 +41,11 @@ module RocketJob
41
41
  @shutdown = false
42
42
  end
43
43
  @name = "#{server_name}:#{id}"
44
- @thread = Thread.new { run } unless inline
45
44
  @re_check_seconds = re_check_seconds || 60
46
45
  @re_check_start = Time.now
47
46
  @filter = filter || {}
48
47
  @current_filter = @filter.dup
48
+ @thread = Thread.new { run } unless inline
49
49
  end
50
50
 
51
51
  if defined?(Concurrent::JavaAtomicBoolean) || defined?(Concurrent::CAtomicBoolean)
@@ -100,7 +100,7 @@ module RocketJob
100
100
  # Only clear out the current_filter after every `re_check_seconds`
101
101
  time = Time.now
102
102
  if (time - @re_check_start) > re_check_seconds.to_f
103
- @recheck_start = time
103
+ @re_check_start = time
104
104
  self.current_filter = filter.dup
105
105
  end
106
106
 
@@ -36,21 +36,21 @@ class DirmonEntryTest < Minitest::Test
36
36
  describe 'with a nil job_class_name' do
37
37
  it 'return nil' do
38
38
  entry = RocketJob::DirmonEntry.new
39
- assert_equal(nil, entry.job_class)
39
+ assert_nil entry.job_class
40
40
  end
41
41
  end
42
42
 
43
43
  describe 'with an unknown job_class_name' do
44
44
  it 'return nil' do
45
45
  entry = RocketJob::DirmonEntry.new(job_class_name: 'FakeJobThatDoesNotExistAnyWhereIPromise')
46
- assert_equal(nil, entry.job_class)
46
+ assert_nil entry.job_class
47
47
  end
48
48
  end
49
49
 
50
50
  describe 'with a valid job_class_name' do
51
51
  it 'return job class' do
52
52
  entry = RocketJob::DirmonEntry.new(job_class_name: 'RocketJob::Job')
53
- assert_equal(RocketJob::Job, entry.job_class)
53
+ assert_equal RocketJob::Job, entry.job_class
54
54
  assert_equal 0, entry.properties.size
55
55
  end
56
56
  end
@@ -231,7 +231,7 @@ class DirmonEntryTest < Minitest::Test
231
231
  @entry.each do |file_name|
232
232
  files << file_name
233
233
  end
234
- assert_equal nil, @entry.archive_directory
234
+ assert_nil @entry.archive_directory
235
235
  assert_equal 1, files.count
236
236
  assert_equal Pathname.new('test/files/text.txt').realpath, files.first
237
237
  end
@@ -263,7 +263,7 @@ class DirmonEntryTest < Minitest::Test
263
263
  files << file_name
264
264
  end
265
265
  end
266
- assert_equal nil, @entry.archive_directory
266
+ assert_nil @entry.archive_directory
267
267
  assert_equal 1, files.count
268
268
  assert_equal Pathname.new('test/files/text.txt').realpath, files.first
269
269
  end
@@ -276,7 +276,7 @@ class DirmonEntryTest < Minitest::Test
276
276
  files << file_name
277
277
  end
278
278
  end
279
- assert_equal nil, @entry.archive_directory
279
+ assert_nil @entry.archive_directory
280
280
  assert_equal 0, files.count
281
281
  end
282
282
  end
@@ -55,7 +55,7 @@ class DirmonJobTest < Minitest::Test
55
55
  result = @entry.stub(:later, -> fn { started = true }) do
56
56
  @dirmon_job.send(:check_file, @entry, file, previous_size)
57
57
  end
58
- assert_equal nil, result
58
+ assert_nil result
59
59
  assert started
60
60
  end
61
61
 
data/test/job_test.rb CHANGED
@@ -59,7 +59,7 @@ class JobTest < Minitest::Test
59
59
  @job.reload
60
60
 
61
61
  assert @job.queued?
62
- assert_equal nil, @job.worker_name
62
+ assert_nil @job.worker_name
63
63
 
64
64
  assert_equal worker_name2, @job2.worker_name
65
65
  @job2.reload
@@ -53,7 +53,7 @@ module Plugins
53
53
  @job.reload
54
54
  assert @job.data.is_a?(Hash), @job.data.class.ai
55
55
  assert_equal 'value', @job.data['key']
56
- assert_equal nil, @job.worker_name
56
+ assert_nil @job.worker_name
57
57
  end
58
58
  end
59
59
 
@@ -29,7 +29,7 @@ module Plugins
29
29
  @job.reload
30
30
 
31
31
  assert @job.queued?
32
- assert_equal nil, @job.worker_name
32
+ assert_nil @job.worker_name
33
33
  end
34
34
  end
35
35
 
@@ -43,7 +43,7 @@ module Plugins
43
43
 
44
44
  @job.requeue(worker_name)
45
45
  assert @job.queued?
46
- assert_equal nil, @job.worker_name
46
+ assert_nil @job.worker_name
47
47
 
48
48
  @job.reload
49
49
  assert @job.running?
@@ -76,8 +76,8 @@ module Plugins
76
76
  assert @job.failed?
77
77
  assert exc = @job.exception
78
78
  assert_equal 'RocketJob::JobException', exc.class_name
79
- assert_equal nil, exc.message
80
- assert_equal nil, exc.worker_name
79
+ assert_nil exc.message
80
+ assert_nil exc.worker_name
81
81
  assert_equal [], exc.backtrace
82
82
  end
83
83
 
@@ -107,8 +107,8 @@ module Plugins
107
107
 
108
108
  @job.retry!
109
109
  assert @job.queued?
110
- assert_equal nil, @job.worker_name
111
- assert_equal nil, @job.exception
110
+ assert_nil @job.worker_name
111
+ assert_nil @job.exception
112
112
  end
113
113
  end
114
114
 
@@ -48,7 +48,7 @@ module Plugins
48
48
  end
49
49
 
50
50
  it 'return nil when no jobs available' do
51
- assert_equal nil, RocketJob::Job.rocket_job_next_job(@worker.name)
51
+ assert_nil RocketJob::Job.rocket_job_next_job(@worker.name)
52
52
  end
53
53
 
54
54
  it 'return the first job' do
@@ -60,7 +60,7 @@ module Plugins
60
60
  it 'Ignore future dated jobs' do
61
61
  @job.run_at = Time.now + 1.hour
62
62
  @job.save!
63
- assert_equal nil, RocketJob::Job.rocket_job_next_job(@worker.name)
63
+ assert_nil RocketJob::Job.rocket_job_next_job(@worker.name)
64
64
  end
65
65
 
66
66
  it 'Process future dated jobs when time is now' do
@@ -74,7 +74,7 @@ module Plugins
74
74
  count = RocketJob::Job.count
75
75
  @job.expires_at = Time.now - 100
76
76
  @job.save!
77
- assert_equal nil, RocketJob::Job.rocket_job_next_job(@worker.name)
77
+ assert_nil RocketJob::Job.rocket_job_next_job(@worker.name)
78
78
  assert_equal count, RocketJob::Job.count
79
79
  end
80
80
  end
@@ -62,7 +62,7 @@ module Plugins
62
62
  assert @job.expired?
63
63
  @job.abort!
64
64
  assert_equal 1, RestartableJob.count
65
- assert_equal nil, RestartableJob.where(:id.ne => @job.id).first
65
+ assert_nil RestartableJob.where(:id.ne => @job.id).first
66
66
  end
67
67
  end
68
68
 
@@ -132,7 +132,7 @@ module Plugins
132
132
  assert @job.running?
133
133
  assert @job.expired?
134
134
  assert_equal 1, RestartableJob.count
135
- assert_equal nil, RestartableJob.where(:id.ne => @job.id).first
135
+ assert_nil RestartableJob.where(:id.ne => @job.id).first
136
136
  end
137
137
  end
138
138
 
@@ -160,16 +160,16 @@ module Plugins
160
160
  assert_equal value, job2[key], "Attributes are supposed to be copied across. For #{key}"
161
161
  end
162
162
 
163
- assert_equal nil, job2.start_at
164
- assert_equal nil, job2.end_at
163
+ assert_nil job2.start_at
164
+ assert_nil job2.end_at
165
165
  assert_equal :queued, job2.state
166
166
  assert job2.created_at
167
- assert_equal nil, job2.started_at
168
- assert_equal nil, job2.completed_at
167
+ assert_nil job2.started_at
168
+ assert_nil job2.completed_at
169
169
  assert_equal 0, job2.failure_count
170
- assert_equal nil, job2.worker_name
170
+ assert_nil job2.worker_name
171
171
  assert_equal 0, job2.percent_complete
172
- assert_equal nil, job2.exception
172
+ assert_nil job2.exception
173
173
  refute job2.result
174
174
  end
175
175
 
@@ -186,7 +186,7 @@ module Plugins
186
186
  @job.perform_now
187
187
  assert_equal 1, RestartableJob.count
188
188
  assert job2 = RestartableJob.where(:id.ne => @job.id).first
189
- assert_equal nil, job2.run_at
189
+ assert_nil job2.run_at
190
190
  end
191
191
  end
192
192
 
data/test/test_helper.rb CHANGED
@@ -7,17 +7,15 @@ rescue LoadError
7
7
  end
8
8
  require 'yaml'
9
9
  require 'minitest/autorun'
10
- require 'minitest/reporters'
11
10
  require 'minitest/stub_any_instance'
12
11
  require 'awesome_print'
13
12
  require 'rocketjob'
14
13
 
15
- MiniTest::Reporters.use! MiniTest::Reporters::SpecReporter.new
16
-
17
14
  SemanticLogger.add_appender(file_name: 'test.log', formatter: :color)
18
15
  SemanticLogger.default_level = :debug
19
16
 
20
17
  RocketJob::Config.load!('test', 'test/config/mongoid.yml')
21
18
  Mongoid.logger = SemanticLogger[Mongoid]
19
+ Mongo::Logger.logger = SemanticLogger[Mongo]
22
20
 
23
21
  #RocketJob::Job.collection.database.command(dropDatabase: 1)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocketjob
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc2
4
+ version: 3.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-30 00:00:00.000000000 Z
11
+ date: 2016-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: 1.3.1
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.5.1
173
+ rubygems_version: 2.6.8
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Ruby's missing batch system.