-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
140 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
*.DS_Store | ||
|
||
pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,15 @@ Gem::Specification.new do |s| | |
s.version = DelayedCron::VERSION | ||
|
||
s.authors = ["Justin Grubbs"] | ||
s.summary = %q{Run your cron jobs with sidekiq, delayed_job, or resque.} | ||
s.description = %q{Run your cron jobs with sidekiq, delayed_job, or resque.} | ||
s.summary = %q{Run your cron jobs with sidekiq, delayed_job, resque, or sucker_punch.} | ||
s.description = %q{Run your cron jobs with sidekiq, delayed_job, resque, or sucker_punch.} | ||
s.email = %q{[email protected]} | ||
s.homepage = %q{http://github.com/sellect/delayed_cron} | ||
|
||
s.add_development_dependency "delayed_job" | ||
s.add_development_dependency "resque" | ||
s.add_development_dependency "sidekiq" | ||
s.add_development_dependency "sucker_punch" | ||
s.add_development_dependency "rspec" | ||
s.add_development_dependency "rails" | ||
s.add_development_dependency "debugger" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'sidekiq/worker' | ||
require 'sidekiq/api' | ||
|
||
module DelayedCron | ||
module Jobs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'sucker_punch' | ||
|
||
module DelayedCron | ||
module Jobs | ||
class SuckerPunch | ||
include ::SuckerPunch::Job | ||
|
||
def self.enqueue_delayed_cron(klass, method_name, options) | ||
unless scheduled?(klass) | ||
options.symbolize_keys! | ||
self.new.later(options[:interval], klass, method_name, options) | ||
end | ||
end | ||
|
||
def self.scheduled?(klass) | ||
::SuckerPunch::Queue.new(klass).registered? | ||
end | ||
|
||
def perform(klass, method_name, options) | ||
DelayedCron.process_job(klass, method_name, options) | ||
end | ||
|
||
def later(sec, *args) | ||
after(sec) { perform(*args) } | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module DelayedCron | ||
VERSION = "0.2.1" | ||
VERSION = "0.2.2" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters