rufus-scheduler 2.0.24 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +76 -0
- data/CREDITS.txt +23 -0
- data/LICENSE.txt +1 -1
- data/README.md +1439 -0
- data/Rakefile +1 -5
- data/TODO.txt +149 -55
- data/lib/rufus/{sc → scheduler}/cronline.rb +167 -53
- data/lib/rufus/scheduler/job_array.rb +92 -0
- data/lib/rufus/scheduler/jobs.rb +633 -0
- data/lib/rufus/scheduler/locks.rb +95 -0
- data/lib/rufus/scheduler/util.rb +306 -0
- data/lib/rufus/scheduler/zones.rb +174 -0
- data/lib/rufus/scheduler/zotime.rb +154 -0
- data/lib/rufus/scheduler.rb +608 -27
- data/rufus-scheduler.gemspec +6 -4
- data/spec/basics_spec.rb +54 -0
- data/spec/cronline_spec.rb +479 -152
- data/spec/error_spec.rb +139 -0
- data/spec/job_array_spec.rb +39 -0
- data/spec/job_at_spec.rb +58 -0
- data/spec/job_cron_spec.rb +128 -0
- data/spec/job_every_spec.rb +104 -0
- data/spec/job_in_spec.rb +20 -0
- data/spec/job_interval_spec.rb +68 -0
- data/spec/job_repeat_spec.rb +357 -0
- data/spec/job_spec.rb +498 -109
- data/spec/lock_custom_spec.rb +47 -0
- data/spec/lock_flock_spec.rb +47 -0
- data/spec/lock_lockfile_spec.rb +61 -0
- data/spec/lock_spec.rb +59 -0
- data/spec/parse_spec.rb +263 -0
- data/spec/schedule_at_spec.rb +158 -0
- data/spec/schedule_cron_spec.rb +66 -0
- data/spec/schedule_every_spec.rb +109 -0
- data/spec/schedule_in_spec.rb +80 -0
- data/spec/schedule_interval_spec.rb +128 -0
- data/spec/scheduler_spec.rb +928 -124
- data/spec/spec_helper.rb +126 -0
- data/spec/threads_spec.rb +96 -0
- data/spec/zotime_spec.rb +396 -0
- metadata +56 -33
- data/README.rdoc +0 -661
- data/lib/rufus/otime.rb +0 -3
- data/lib/rufus/sc/jobqueues.rb +0 -160
- data/lib/rufus/sc/jobs.rb +0 -471
- data/lib/rufus/sc/rtime.rb +0 -363
- data/lib/rufus/sc/scheduler.rb +0 -636
- data/lib/rufus/sc/version.rb +0 -32
- data/spec/at_in_spec.rb +0 -47
- data/spec/at_spec.rb +0 -125
- data/spec/blocking_spec.rb +0 -64
- data/spec/cron_spec.rb +0 -134
- data/spec/every_spec.rb +0 -304
- data/spec/exception_spec.rb +0 -113
- data/spec/in_spec.rb +0 -150
- data/spec/mutex_spec.rb +0 -159
- data/spec/rtime_spec.rb +0 -137
- data/spec/schedulable_spec.rb +0 -97
- data/spec/spec_base.rb +0 -87
- data/spec/stress_schedule_unschedule_spec.rb +0 -159
- data/spec/timeout_spec.rb +0 -148
- data/test/kjw.rb +0 -113
- data/test/t.rb +0 -20
data/spec/basics_spec.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Specifying rufus-scheduler
|
4
|
+
#
|
5
|
+
# Sun Jun 1 05:52:24 JST 2014
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'spec_helper'
|
9
|
+
|
10
|
+
|
11
|
+
describe 'basics' do
|
12
|
+
|
13
|
+
def tts(time)
|
14
|
+
|
15
|
+
time.strftime('%Y-%m-%d %H:%M:%S %z') + (time.dst? ? ' dst' : '')
|
16
|
+
end
|
17
|
+
|
18
|
+
describe 'Time.new' do
|
19
|
+
|
20
|
+
it 'accepts a timezone final argument' do
|
21
|
+
|
22
|
+
if jruby? or ruby18?
|
23
|
+
|
24
|
+
expect(true).to be(true)
|
25
|
+
|
26
|
+
else
|
27
|
+
|
28
|
+
expect(
|
29
|
+
tts(Time.new(2014, 1, 1, 1, 0, 0, '+01:00'))
|
30
|
+
).to eq('2014-01-01 01:00:00 +0100')
|
31
|
+
expect(
|
32
|
+
tts(Time.new(2014, 8, 1, 1, 0, 0, '+01:00'))
|
33
|
+
).to eq('2014-08-01 01:00:00 +0100')
|
34
|
+
expect(
|
35
|
+
tts(Time.new(2014, 8, 1, 1, 0, 0, '+01:00'))
|
36
|
+
).to eq('2014-08-01 01:00:00 +0100')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'Time.local' do
|
42
|
+
|
43
|
+
it 'works as expected' do
|
44
|
+
|
45
|
+
expect(
|
46
|
+
tts(in_zone('Europe/Berlin') { Time.local(2014, 1, 1, 1, 0, 0) })
|
47
|
+
).to eq('2014-01-01 01:00:00 +0100')
|
48
|
+
expect(
|
49
|
+
tts(in_zone('Europe/Berlin') { Time.local(2014, 8, 1, 1, 0, 0) })
|
50
|
+
).to eq('2014-08-01 01:00:00 +0200 dst')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|