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.
Files changed (63) hide show
  1. data/CHANGELOG.txt +76 -0
  2. data/CREDITS.txt +23 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +1439 -0
  5. data/Rakefile +1 -5
  6. data/TODO.txt +149 -55
  7. data/lib/rufus/{sc → scheduler}/cronline.rb +167 -53
  8. data/lib/rufus/scheduler/job_array.rb +92 -0
  9. data/lib/rufus/scheduler/jobs.rb +633 -0
  10. data/lib/rufus/scheduler/locks.rb +95 -0
  11. data/lib/rufus/scheduler/util.rb +306 -0
  12. data/lib/rufus/scheduler/zones.rb +174 -0
  13. data/lib/rufus/scheduler/zotime.rb +154 -0
  14. data/lib/rufus/scheduler.rb +608 -27
  15. data/rufus-scheduler.gemspec +6 -4
  16. data/spec/basics_spec.rb +54 -0
  17. data/spec/cronline_spec.rb +479 -152
  18. data/spec/error_spec.rb +139 -0
  19. data/spec/job_array_spec.rb +39 -0
  20. data/spec/job_at_spec.rb +58 -0
  21. data/spec/job_cron_spec.rb +128 -0
  22. data/spec/job_every_spec.rb +104 -0
  23. data/spec/job_in_spec.rb +20 -0
  24. data/spec/job_interval_spec.rb +68 -0
  25. data/spec/job_repeat_spec.rb +357 -0
  26. data/spec/job_spec.rb +498 -109
  27. data/spec/lock_custom_spec.rb +47 -0
  28. data/spec/lock_flock_spec.rb +47 -0
  29. data/spec/lock_lockfile_spec.rb +61 -0
  30. data/spec/lock_spec.rb +59 -0
  31. data/spec/parse_spec.rb +263 -0
  32. data/spec/schedule_at_spec.rb +158 -0
  33. data/spec/schedule_cron_spec.rb +66 -0
  34. data/spec/schedule_every_spec.rb +109 -0
  35. data/spec/schedule_in_spec.rb +80 -0
  36. data/spec/schedule_interval_spec.rb +128 -0
  37. data/spec/scheduler_spec.rb +928 -124
  38. data/spec/spec_helper.rb +126 -0
  39. data/spec/threads_spec.rb +96 -0
  40. data/spec/zotime_spec.rb +396 -0
  41. metadata +56 -33
  42. data/README.rdoc +0 -661
  43. data/lib/rufus/otime.rb +0 -3
  44. data/lib/rufus/sc/jobqueues.rb +0 -160
  45. data/lib/rufus/sc/jobs.rb +0 -471
  46. data/lib/rufus/sc/rtime.rb +0 -363
  47. data/lib/rufus/sc/scheduler.rb +0 -636
  48. data/lib/rufus/sc/version.rb +0 -32
  49. data/spec/at_in_spec.rb +0 -47
  50. data/spec/at_spec.rb +0 -125
  51. data/spec/blocking_spec.rb +0 -64
  52. data/spec/cron_spec.rb +0 -134
  53. data/spec/every_spec.rb +0 -304
  54. data/spec/exception_spec.rb +0 -113
  55. data/spec/in_spec.rb +0 -150
  56. data/spec/mutex_spec.rb +0 -159
  57. data/spec/rtime_spec.rb +0 -137
  58. data/spec/schedulable_spec.rb +0 -97
  59. data/spec/spec_base.rb +0 -87
  60. data/spec/stress_schedule_unschedule_spec.rb +0 -159
  61. data/spec/timeout_spec.rb +0 -148
  62. data/test/kjw.rb +0 -113
  63. data/test/t.rb +0 -20
@@ -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
+