resque-scheduler 4.2.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of resque-scheduler might be problematic. Click here for more details.

Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CODE_OF_CONDUCT.md +74 -0
  3. data/HISTORY.md +7 -0
  4. data/README.md +7 -6
  5. data/{bin → exe}/resque-scheduler +0 -0
  6. data/lib/resque/scheduler/env.rb +5 -1
  7. data/lib/resque/scheduler/version.rb +1 -1
  8. data/resque-scheduler.gemspec +21 -7
  9. metadata +12 -53
  10. data/.gitignore +0 -17
  11. data/.rubocop.yml +0 -18
  12. data/.rubocop_todo.yml +0 -71
  13. data/.simplecov +0 -3
  14. data/.travis.yml +0 -26
  15. data/.vagrant-provision-as-vagrant.sh +0 -15
  16. data/.vagrant-provision.sh +0 -23
  17. data/.vagrant-skel/bash_profile +0 -7
  18. data/.vagrant-skel/bashrc +0 -7
  19. data/Vagrantfile +0 -14
  20. data/examples/Rakefile +0 -2
  21. data/examples/config/initializers/resque-web.rb +0 -37
  22. data/examples/dynamic-scheduling/README.md +0 -28
  23. data/examples/dynamic-scheduling/app/jobs/fix_schedules_job.rb +0 -52
  24. data/examples/dynamic-scheduling/app/jobs/send_email_job.rb +0 -9
  25. data/examples/dynamic-scheduling/app/models/user.rb +0 -16
  26. data/examples/dynamic-scheduling/config/resque.yml +0 -4
  27. data/examples/dynamic-scheduling/config/static_schedule.yml +0 -7
  28. data/examples/dynamic-scheduling/lib/tasks/resque.rake +0 -48
  29. data/examples/run-resque-web +0 -3
  30. data/script/migrate_to_timestamps_set.rb +0 -16
  31. data/tasks/resque_scheduler.rake +0 -2
  32. data/test/cli_test.rb +0 -231
  33. data/test/delayed_queue_test.rb +0 -925
  34. data/test/env_test.rb +0 -47
  35. data/test/multi_process_test.rb +0 -125
  36. data/test/resque-web_test.rb +0 -364
  37. data/test/scheduler_args_test.rb +0 -222
  38. data/test/scheduler_hooks_test.rb +0 -55
  39. data/test/scheduler_locking_test.rb +0 -316
  40. data/test/scheduler_setup_test.rb +0 -141
  41. data/test/scheduler_task_test.rb +0 -72
  42. data/test/scheduler_test.rb +0 -473
  43. data/test/test_helper.rb +0 -147
  44. data/test/util_test.rb +0 -17
@@ -1,147 +0,0 @@
1
- # vim:fileencoding=utf-8
2
- require 'simplecov'
3
-
4
- require 'test/unit'
5
- require 'minitest'
6
- require 'mocha/setup'
7
- require 'rack/test'
8
- require 'resque'
9
-
10
- $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) + '/../lib'
11
- require 'resque-scheduler'
12
- require 'resque/scheduler/server'
13
-
14
- ##
15
- # test/spec/mini 3
16
- # original work: http://gist.github.com/25455
17
- # forked and modified: https://gist.github.com/meatballhat/8906709
18
- #
19
- def context(*args, &block)
20
- return super unless (name = args.first) && block
21
- require 'test/unit'
22
- klass = Class.new(Test::Unit::TestCase) do
23
- def self.test(name, &block)
24
- define_method("test_#{name.gsub(/\W/, '_')}", &block) if block
25
- end
26
-
27
- def self.xtest(*_args)
28
- end
29
-
30
- def self.setup(&block)
31
- define_method(:setup, &block)
32
- end
33
-
34
- def self.teardown(&block)
35
- define_method(:teardown, &block)
36
- end
37
- end
38
- (class << klass; self end).send(:define_method, :name) do
39
- name.gsub(/\W/, '_')
40
- end
41
- klass.class_eval(&block)
42
- end
43
-
44
- unless defined?(Rails)
45
- module Rails
46
- class << self
47
- attr_accessor :env
48
- end
49
- end
50
- end
51
-
52
- class ExceptionHandlerClass
53
- def self.on_enqueue_failure(_, _); end
54
- end
55
-
56
- class FakeCustomJobClass
57
- def self.scheduled(_, _, *_); end
58
- end
59
-
60
- class FakeCustomJobClassEnqueueAt
61
- @queue = :test
62
- def self.scheduled(_, _, *_); end
63
- end
64
-
65
- class SomeJob
66
- def self.perform(_, _)
67
- end
68
- end
69
-
70
- class SomeIvarJob < SomeJob
71
- @queue = :ivar
72
- end
73
-
74
- class SomeFancyJob < SomeJob
75
- def self.queue
76
- :fancy
77
- end
78
- end
79
-
80
- class SomeSharedEnvJob < SomeJob
81
- def self.queue
82
- :shared_job
83
- end
84
- end
85
-
86
- class SomeQuickJob < SomeJob
87
- @queue = :quick
88
- end
89
-
90
- class SomeRealClass
91
- def self.queue
92
- :some_real_queue
93
- end
94
- end
95
-
96
- class SomeJobWithResqueHooks < SomeRealClass
97
- def before_enqueue_example; end
98
-
99
- def after_enqueue_example; end
100
- end
101
-
102
- class JobWithParams
103
- def self.perform(*args)
104
- @args = args
105
- end
106
- end
107
-
108
- JobWithoutParams = Class.new(JobWithParams)
109
-
110
- %w(
111
- APP_NAME
112
- DYNAMIC_SCHEDULE
113
- LOGFILE
114
- LOGFORMAT
115
- QUIET
116
- RAILS_ENV
117
- RESQUE_SCHEDULER_INTERVAL
118
- VERBOSE
119
- ).each do |envvar|
120
- ENV[envvar] = nil
121
- end
122
-
123
- def nullify_logger
124
- Resque::Scheduler.configure do |c|
125
- c.quiet = nil
126
- c.verbose = nil
127
- c.logfile = nil
128
- c.logger = nil
129
- end
130
-
131
- ENV['LOGFILE'] = nil
132
- end
133
-
134
- def restore_devnull_logfile
135
- nullify_logger
136
- ENV['LOGFILE'] = '/dev/null'
137
- end
138
-
139
- def with_failure_handler(handler)
140
- original_handler = Resque::Scheduler.failure_handler
141
- Resque::Scheduler.failure_handler = handler
142
- yield
143
- ensure
144
- Resque::Scheduler.failure_handler = original_handler
145
- end
146
-
147
- restore_devnull_logfile
@@ -1,17 +0,0 @@
1
- # vim:fileencoding=utf-8
2
-
3
- context 'Util' do
4
- def util
5
- Resque::Scheduler::Util
6
- end
7
-
8
- test 'constantizing' do
9
- assert util.constantize('Resque::Scheduler') == Resque::Scheduler
10
- end
11
-
12
- module ReSchedulIzer; end
13
-
14
- test 'constantizing with a dash' do
15
- assert util.constantize('re-schedul-izer') == ReSchedulIzer
16
- end
17
- end