rufus-scheduler 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ module Rufus
39
39
  require 'rufus/scheduler/job_array'
40
40
  require 'rufus/scheduler/locks'
41
41
 
42
- VERSION = '3.1.0'
42
+ VERSION = '3.2.0'
43
43
 
44
44
  #
45
45
  # A common error class for rufus-scheduler
@@ -385,9 +385,9 @@ module Rufus
385
385
  #
386
386
  def scheduled?(job_or_job_id)
387
387
 
388
- job, job_id = fetch(job_or_job_id)
388
+ job, _ = fetch(job_or_job_id)
389
389
 
390
- !! (job && job.next_time != nil)
390
+ !! (job && job.unscheduled_at.nil? && job.next_time != nil)
391
391
  end
392
392
 
393
393
  # Lists all the threads associated with this scheduler.
@@ -441,7 +441,7 @@ module Rufus
441
441
  if format == :timeline
442
442
  a = []
443
443
  h.each { |j, ts| ts.each { |t| a << [ t, j ] } }
444
- a.sort_by { |(t, j)| t }
444
+ a.sort_by { |(t, _)| t }
445
445
  else
446
446
  h
447
447
  end
@@ -592,11 +592,11 @@ module Rufus
592
592
 
593
593
  job = t[:rufus_scheduler_job]
594
594
  to = t[:rufus_scheduler_timeout]
595
+ ts = t[:rufus_scheduler_time]
595
596
 
596
- next unless job && to
597
+ next unless job && to && ts
597
598
  # thread might just have become inactive (job -> nil)
598
599
 
599
- ts = t[:rufus_scheduler_time]
600
600
  to = to.is_a?(Time) ? to : ts + to
601
601
 
602
602
  next if to > Time.now
@@ -629,7 +629,7 @@ module Rufus
629
629
 
630
630
  job = job_class.new(self, t, opts, block || callable)
631
631
 
632
- raise ArgumentError.new(
632
+ fail ArgumentError.new(
633
633
  "job frequency (#{job.frequency}) is higher than " +
634
634
  "scheduler frequency (#{@frequency})"
635
635
  ) if job.respond_to?(:frequency) && job.frequency < @frequency
@@ -22,7 +22,7 @@ job scheduler for Ruby (at, cron, in and every jobs).
22
22
  #s.files = `git ls-files`.split("\n")
23
23
  s.files = Dir[
24
24
  'Rakefile',
25
- 'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb',
25
+ 'lib/**/*.rb', #'spec/**/*.rb', 'test/**/*.rb',
26
26
  '*.gemspec', '*.txt', '*.rdoc', '*.md'
27
27
  ]
28
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
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: 2015-04-17 00:00:00.000000000 Z
12
+ date: 2015-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -83,45 +83,20 @@ extensions: []
83
83
  extra_rdoc_files: []
84
84
  files:
85
85
  - Rakefile
86
- - lib/rufus-scheduler.rb
87
- - lib/rufus/scheduler.rb
88
- - lib/rufus/scheduler/locks.rb
89
- - lib/rufus/scheduler/zotime.rb
90
86
  - lib/rufus/scheduler/cronline.rb
91
- - lib/rufus/scheduler/util.rb
87
+ - lib/rufus/scheduler/job_array.rb
92
88
  - lib/rufus/scheduler/jobs.rb
89
+ - lib/rufus/scheduler/locks.rb
90
+ - lib/rufus/scheduler/util.rb
93
91
  - lib/rufus/scheduler/zones.rb
94
- - lib/rufus/scheduler/job_array.rb
95
- - spec/job_spec.rb
96
- - spec/schedule_in_spec.rb
97
- - spec/zotime_spec.rb
98
- - spec/spec_helper.rb
99
- - spec/job_array_spec.rb
100
- - spec/schedule_interval_spec.rb
101
- - spec/job_at_spec.rb
102
- - spec/schedule_at_spec.rb
103
- - spec/error_spec.rb
104
- - spec/lock_spec.rb
105
- - spec/schedule_cron_spec.rb
106
- - spec/job_interval_spec.rb
107
- - spec/job_repeat_spec.rb
108
- - spec/schedule_every_spec.rb
109
- - spec/threads_spec.rb
110
- - spec/cronline_spec.rb
111
- - spec/lock_lockfile_spec.rb
112
- - spec/job_in_spec.rb
113
- - spec/parse_spec.rb
114
- - spec/scheduler_spec.rb
115
- - spec/lock_custom_spec.rb
116
- - spec/basics_spec.rb
117
- - spec/job_cron_spec.rb
118
- - spec/job_every_spec.rb
119
- - spec/lock_flock_spec.rb
92
+ - lib/rufus/scheduler/zotime.rb
93
+ - lib/rufus/scheduler.rb
94
+ - lib/rufus-scheduler.rb
120
95
  - rufus-scheduler.gemspec
121
96
  - CHANGELOG.txt
122
- - TODO.txt
123
- - LICENSE.txt
124
97
  - CREDITS.txt
98
+ - LICENSE.txt
99
+ - TODO.txt
125
100
  - README.md
126
101
  homepage: http://github.com/jmettraux/rufus-scheduler
127
102
  licenses:
@@ -144,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
119
  version: '0'
145
120
  requirements: []
146
121
  rubyforge_project: rufus
147
- rubygems_version: 1.8.23
122
+ rubygems_version: 1.8.23.2
148
123
  signing_key:
149
124
  specification_version: 3
150
125
  summary: job scheduler for Ruby (at, cron, in and every jobs)
data/spec/basics_spec.rb DELETED
@@ -1,54 +0,0 @@
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
-