sidekiq-scheduler 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # SidekiqScheduler
2
2
 
3
+ # Warning!
4
+
5
+ The original function of this gem was to add delayed jobs for a fixed amount of time.
6
+ This has been available directly within Sidekiq since Version 2.0. A lot of this code
7
+ should be considered redundant and might even conflict with the latest Sidekiq release.
8
+
9
+ Since I have upgraded my projects that made use of this gem to the core Sidekiq functions and
10
+ no longer make active use of this gem this project should be considered largely unmaintained.
11
+
3
12
  ## Description
4
13
 
5
14
  sidekiq-scheduler is an extension to [Sidekiq](http://github.com/mperham/sidekiq)
@@ -9,7 +18,7 @@ This table explains the version requirements for redis
9
18
 
10
19
  | sidekiq-scheduler version | required redis version|
11
20
  |:--------------------------|----------------------:|
12
- | ~> 1.0.0 | >= 2.2.0 |
21
+ | >= 1.0.0 | >= 2.2.0 |
13
22
 
14
23
  Job scheduling is supported in two different way: Recurring (scheduled) and
15
24
  Delayed.
@@ -31,7 +40,7 @@ details on individual methods, you might want to try the [rdoc](http://rdoc.info
31
40
  ## Installation
32
41
 
33
42
  #To install:
34
- gem install resque-scheduler
43
+ gem install sidekiq-scheduler
35
44
 
36
45
  #If you use a Gemfile:
37
46
  gem 'sidekiq-scheduler'
@@ -196,6 +205,8 @@ Sidekiq uses a jobs array on workers for testing, which is supported by sidekiq-
196
205
  This work is a partial port of [resque-scheduler](https://github.com/bvandenbos/resque-scheduler) by Ben VandenBos.
197
206
  Modified to work with the Sidekiq queueing library by Morton Jonuschat.
198
207
 
208
+ Scheduling of recurring jobs has been addet to v0.4.0, thanks to [Adrian Gomez](https://github.com/adrian-gomez).
209
+
199
210
  ## Maintainers
200
211
 
201
212
  * [Morton Jonuschat](https://github.com/yabawock)
@@ -1,3 +1,3 @@
1
1
  module SidekiqScheduler
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -111,10 +111,13 @@ module Sidekiq
111
111
 
112
112
  # Enqueue a job based on a config hash
113
113
  def self.enqueue_from_config(job_config)
114
- job_config['class'] = constantize(job_config['class']) # Sidekiq expects the class to be constantized.
115
- job_config['args'] = '' if job_config['args'].nil?
114
+ args = job_config[:args] || job_config['args']
115
+ args = args.is_a?(Hash) ? [args] : Array(args)
116
+
117
+ klass_name = job_config[:class] || job_config['class']
118
+ klass = klass_name.constantize rescue constantize(klass_name)
116
119
 
117
- Sidekiq::Client.push(job_config)
120
+ Sidekiq::Client.push({ 'class' => klass, 'args' => args })
118
121
  end
119
122
 
120
123
  def self.rufus_scheduler
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-26 00:00:00.000000000 Z
12
+ date: 2013-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -149,31 +149,31 @@ extensions: []
149
149
  extra_rdoc_files: []
150
150
  files:
151
151
  - bin/sidekiq-scheduler
152
- - lib/sidekiq/scheduler.rb
153
- - lib/sidekiq-scheduler/capistrano.rb
154
- - lib/sidekiq-scheduler/cli.rb
155
152
  - lib/sidekiq-scheduler/client.rb
153
+ - lib/sidekiq-scheduler/cli.rb
156
154
  - lib/sidekiq-scheduler/manager.rb
155
+ - lib/sidekiq-scheduler/capistrano.rb
157
156
  - lib/sidekiq-scheduler/schedule.rb
158
- - lib/sidekiq-scheduler/testing.rb
159
- - lib/sidekiq-scheduler/version.rb
160
157
  - lib/sidekiq-scheduler/worker.rb
158
+ - lib/sidekiq-scheduler/version.rb
159
+ - lib/sidekiq-scheduler/testing.rb
161
160
  - lib/sidekiq-scheduler.rb
162
161
  - lib/tasks/sidekiq-scheduler_tasks.rake
162
+ - lib/sidekiq/scheduler.rb
163
163
  - MIT-LICENSE
164
164
  - Rakefile
165
165
  - README.md
166
- - test/cli_test.rb
167
- - test/client_test.rb
168
- - test/config.yml
169
- - test/fake_env.rb
170
- - test/lib/sidekiq/scheduler_test.rb
171
- - test/manager_test.rb
172
- - test/schedule_test.rb
173
166
  - test/support/direct_worker.rb
174
167
  - test/support/my_worker.rb
168
+ - test/config.yml
169
+ - test/manager_test.rb
170
+ - test/fake_env.rb
175
171
  - test/test_helper.rb
172
+ - test/lib/sidekiq/scheduler_test.rb
173
+ - test/cli_test.rb
176
174
  - test/testing_test.rb
175
+ - test/schedule_test.rb
176
+ - test/client_test.rb
177
177
  homepage: https://github.com/yabawock/sidekiq-scheduler
178
178
  licenses: []
179
179
  post_install_message:
@@ -188,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  segments:
190
190
  - 0
191
- hash: -1906038753253799220
191
+ hash: -363015005747774647
192
192
  required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  segments:
199
199
  - 0
200
- hash: -1906038753253799220
200
+ hash: -363015005747774647
201
201
  requirements: []
202
202
  rubyforge_project:
203
203
  rubygems_version: 1.8.23
@@ -205,14 +205,14 @@ signing_key:
205
205
  specification_version: 3
206
206
  summary: Light weight job scheduling extension for Sidekiq
207
207
  test_files:
208
- - test/cli_test.rb
209
- - test/client_test.rb
210
- - test/config.yml
211
- - test/fake_env.rb
212
- - test/lib/sidekiq/scheduler_test.rb
213
- - test/manager_test.rb
214
- - test/schedule_test.rb
215
208
  - test/support/direct_worker.rb
216
209
  - test/support/my_worker.rb
210
+ - test/config.yml
211
+ - test/manager_test.rb
212
+ - test/fake_env.rb
217
213
  - test/test_helper.rb
214
+ - test/lib/sidekiq/scheduler_test.rb
215
+ - test/cli_test.rb
218
216
  - test/testing_test.rb
217
+ - test/schedule_test.rb
218
+ - test/client_test.rb