delayed_job_groups_plugin 0.1.0 → 0.1.1

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: 2a4de75ba53fbd7b7777b5c65ccdbb29a509cf51
4
- data.tar.gz: 611191660f2dcf4b942efe7916006e1f710a8e29
3
+ metadata.gz: 40f1d73ab96a59d9a844454f73355c43fe4adece
4
+ data.tar.gz: d3f901a08c15556844f649ec5c63d2ebc8f5ae7f
5
5
  SHA512:
6
- metadata.gz: 0894bd53ffa33e924e1319034f462f7cd2e4b6e2b0ca39bc9cb4209dbdcf89cd5f36cfcca63012639685a05e86aa4402b97608faa672debc4607b6c96b55f106
7
- data.tar.gz: b301f22a1c2334058f8d6f3b4c463e5be9cc7aa252d60a713ef79d328a2ea0692e610fd123e1fb367bf8cd4d215c0f0d5e34350fb5df26605fe262ccef6b3ad9
6
+ metadata.gz: 3b440e778b155e86b9ed22d00b4737b3d16ab951abffae076614ffea30d7e55cead394a51977b4e23b1f7458eda130b47963360cc6dd0aa38e49b939e3c03a68
7
+ data.tar.gz: 3855f98e948a154ef67918f1ef8f370da4ab3d6f01a9382a723d530e526e350d0ddbafa613adebd3ed8251b5a4dec35e90d2dd5986d83851d95e6c4d9ec791ca
data/.travis.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  env:
3
3
  matrix:
4
- - RAILS_VERSION="~> 3.2.0" JRUBY_OPTS="$JRUBY_OPTS --debug"
5
- - RAILS_VERSION="~> 4.0.0" JRUBY_OPTS="$JRUBY_OPTS --debug"
4
+ - RAILS_VERSION="~> 3.2.19" JRUBY_OPTS="$JRUBY_OPTS --debug"
5
+ - RAILS_VERSION="~> 4.0.10" JRUBY_OPTS="$JRUBY_OPTS --debug"
6
6
  rvm:
7
7
  - 1.9.3
8
8
  - 2.0.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+
3
+ ### 0.1.1
4
+ * Update the run_at for all jobs in a JobGroup when it's unblocked.
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Delayed Job Groups
2
+ [![Gem Version](https://badge.fury.io/rb/delayed_job_groups_plugin.png)][gem]
2
3
  [![Build Status](https://secure.travis-ci.org/salsify/delayed_job_groups_plugin.png?branch=master)][travis]
3
4
  [![Code Climate](https://codeclimate.com/github/salsify/delayed_job_groups_plugin.png)][codeclimate]
4
5
  [![Coverage Status](https://coveralls.io/repos/salsify/delayed_job_groups_plugin/badge.png)][coveralls]
5
6
 
7
+ [gem]: https://rubygems.org/gems/delayed_job_groups_plugin
6
8
  [travis]: http://travis-ci.org/salsify/delayed_job_groups_plugin
7
9
  [codeclimate]: https://codeclimate.com/github/salsify/delayed_job_groups_plugin
8
10
  [coveralls]: https://coveralls.io/r/salsify/delayed_job_groups_plugin
@@ -24,8 +24,9 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'coveralls'
25
25
  spec.add_development_dependency 'database_cleaner', '>= 1.2'
26
26
  spec.add_development_dependency 'rake'
27
- spec.add_development_dependency 'rspec', '>= 2.14'
27
+ spec.add_development_dependency 'rspec', '>= 2.14', '< 2.99'
28
28
  spec.add_development_dependency 'simplecov', '~> 0.7.1'
29
+ spec.add_development_dependency 'timecop'
29
30
 
30
31
  if RUBY_PLATFORM == 'java'
31
32
  spec.add_development_dependency 'jdbc-sqlite3'
@@ -54,7 +54,7 @@ module Delayed
54
54
 
55
55
  with_lock do
56
56
  update_column(:blocked, false)
57
- active_jobs.update_all(blocked: false)
57
+ active_jobs.update_all(blocked: false, run_at: Delayed::Job.db_time_now)
58
58
  complete if ready_for_completion?
59
59
  end
60
60
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Delayed
4
4
  module JobGroups
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
@@ -18,10 +18,14 @@ describe Delayed::JobGroups::JobGroup do
18
18
  end
19
19
 
20
20
  before do
21
- Time.stub(:now).and_return(current_time)
21
+ Timecop.freeze(current_time)
22
22
  Delayed::Job.stub(:enqueue)
23
23
  end
24
24
 
25
+ after do
26
+ Timecop.return
27
+ end
28
+
25
29
  shared_examples "the job group was completed" do
26
30
  it "queues the completion job" do
27
31
  Delayed::Job.should have_received(:enqueue).with(on_completion_job, on_completion_job_options)
@@ -173,16 +177,17 @@ describe Delayed::JobGroups::JobGroup do
173
177
 
174
178
  context "when there are pending jobs" do
175
179
  let!(:job) { Delayed::Job.create!(job_group_id: job_group.id, blocked: true) }
180
+ let(:unblock_time) { Time.utc(2014) }
176
181
 
177
182
  before do
178
183
  job_group.mark_queueing_complete
179
- job_group.unblock
184
+ Timecop.freeze(unblock_time) { job_group.unblock }
180
185
  end
181
186
 
182
187
  its(:blocked?) { should be_false }
183
188
 
184
- it "sets the job's run_at to the current time" do
185
- job.reload.run_at.should eq current_time
189
+ it "sets the job's run_at to the unblocked time" do
190
+ job.reload.run_at.should eq unblock_time
186
191
  end
187
192
 
188
193
  it_behaves_like "the job group was not completed"
data/spec/spec_helper.rb CHANGED
@@ -14,6 +14,7 @@ end
14
14
  require 'database_cleaner'
15
15
  require 'delayed_job_groups_plugin'
16
16
  require 'yaml'
17
+ require 'timecop'
17
18
 
18
19
  spec_dir = File.dirname(__FILE__)
19
20
  Dir["#{spec_dir}/support/**/*.rb"].sort.each { |f| require f }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_groups_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Turkel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-23 00:00:00.000000000 Z
11
+ date: 2014-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: delayed_job
@@ -107,6 +107,9 @@ dependencies:
107
107
  - - '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '2.14'
110
+ - - <
111
+ - !ruby/object:Gem::Version
112
+ version: '2.99'
110
113
  type: :development
111
114
  prerelease: false
112
115
  version_requirements: !ruby/object:Gem::Requirement
@@ -114,6 +117,9 @@ dependencies:
114
117
  - - '>='
115
118
  - !ruby/object:Gem::Version
116
119
  version: '2.14'
120
+ - - <
121
+ - !ruby/object:Gem::Version
122
+ version: '2.99'
117
123
  - !ruby/object:Gem::Dependency
118
124
  name: simplecov
119
125
  requirement: !ruby/object:Gem::Requirement
@@ -128,6 +134,20 @@ dependencies:
128
134
  - - ~>
129
135
  - !ruby/object:Gem::Version
130
136
  version: 0.7.1
137
+ - !ruby/object:Gem::Dependency
138
+ name: timecop
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - '>='
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
131
151
  - !ruby/object:Gem::Dependency
132
152
  name: sqlite3
133
153
  requirement: !ruby/object:Gem::Requirement
@@ -153,6 +173,7 @@ files:
153
173
  - .gitignore
154
174
  - .rspec
155
175
  - .travis.yml
176
+ - CHANGELOG.md
156
177
  - Gemfile
157
178
  - LICENSE.txt
158
179
  - README.md
@@ -192,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
213
  version: '0'
193
214
  requirements: []
194
215
  rubyforge_project:
195
- rubygems_version: 2.0.14
216
+ rubygems_version: 2.2.2
196
217
  signing_key:
197
218
  specification_version: 4
198
219
  summary: Delayed::Job job groups plugin