rufus-scheduler 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -2,6 +2,11 @@
2
2
  = rufus-scheduler CHANGELOG.txt
3
3
 
4
4
 
5
+ == rufus-scheduler - 2.0.8 released 2010/12/31
6
+
7
+ - issue with cron '0 7-23/2 * * *' fixed. Thanks Pickerel
8
+
9
+
5
10
  == rufus-scheduler - 2.0.7 released 2010/11/09
6
11
 
7
12
  - cron and timezones, thanks Tanzeeb Khalili
data/CREDITS.txt CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  == Contributors
6
6
 
7
+ - Chris Kampemeier (http://github.com/chrisk) rspec 2.0 refinements
7
8
  - Tanzeeb Khalili (http://github.com/tanzeeb) cron and timezones
8
9
  - Adam Davies (http://github.com/adz), @allow_overlap = false
9
10
  - Klaas Jan Wierenga, at/every/in stress tests (1.0 and 2.0)
@@ -12,6 +13,7 @@
12
13
 
13
14
  == Feedback
14
15
 
16
+ - pickerel - https://github.com/pickerel
15
17
  - Gonzalo Suarez - parse_time_string(s) issue
16
18
  - Tony Day - http://github.com/tonyday - every and overlapping timeout issue
17
19
  - Nate Wiger (Schedulable call/trigger issue)
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2005-2010, John Mettraux, jmettraux@gmail.com
2
+ Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
data/README.rdoc CHANGED
@@ -359,6 +359,13 @@ More and more ruby applications are using EventMachine. This flavour of the sche
359
359
  }
360
360
 
361
361
 
362
+ == with Passenger
363
+
364
+ "it terminates for no apparent reason !"
365
+
366
+ https://github.com/jmettraux/rufus-scheduler/issues/issue/10
367
+
368
+
362
369
  == tested with
363
370
 
364
371
  * 1.8.7-p249
data/Rakefile CHANGED
@@ -1,21 +1,23 @@
1
1
 
2
- require 'rubygems'
3
- require 'rake'
2
+ $:.unshift('.') # 1.9.2
4
3
 
4
+ require 'rubygems'
5
5
 
6
- load 'lib/rufus/sc/version.rb'
6
+ require 'rake'
7
+ require 'rake/clean'
8
+ require 'rake/rdoctask'
7
9
 
8
10
 
9
11
  #
10
- # CLEAN
12
+ # clean
11
13
 
12
- require 'rake/clean'
13
- CLEAN.include('pkg', 'tmp', 'rdoc')
14
+ CLEAN.include('pkg', 'rdoc')
14
15
 
15
16
 
16
17
  #
17
- # TEST / SPEC
18
+ # test / spec
18
19
 
20
+ #task :spec => :check_dependencies do
19
21
  task :spec do
20
22
  sh 'rspec spec/'
21
23
  end
@@ -25,64 +27,59 @@ task :default => :spec
25
27
 
26
28
 
27
29
  #
28
- # GEM
29
-
30
- require 'jeweler'
30
+ # gem
31
31
 
32
- Jeweler::Tasks.new do |gem|
32
+ GEMSPEC_FILE = Dir['*.gemspec'].first
33
+ GEMSPEC = eval(File.read(GEMSPEC_FILE))
34
+ GEMSPEC.validate
33
35
 
34
- gem.version = Rufus::Scheduler::VERSION
35
- gem.name = 'rufus-scheduler'
36
- gem.summary = 'job scheduler for Ruby (at, cron, in and every jobs)'
37
36
 
38
- gem.description = %{
39
- job scheduler for Ruby (at, cron, in and every jobs).
37
+ desc %{
38
+ builds the gem and places it in pkg/
39
+ }
40
+ task :build do
40
41
 
41
- By default uses a Ruby thread, if EventMachine is present, it will rely on it.
42
- }
43
- gem.email = 'jmettraux@gmail.com'
44
- gem.homepage = 'http://github.com/jmettraux/rufus-scheduler/'
45
- gem.authors = [ 'John Mettraux' ]
46
- gem.rubyforge_project = 'rufus'
47
-
48
- #gem.test_file = 'spec/spec.rb'
42
+ sh "gem build #{GEMSPEC_FILE}"
43
+ sh "mkdir pkg" rescue nil
44
+ sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem pkg/"
45
+ end
49
46
 
50
- gem.add_dependency 'tzinfo'
51
- gem.add_development_dependency 'rake'
52
- gem.add_development_dependency 'rspec'
53
- gem.add_development_dependency 'jeweler'
47
+ desc %{
48
+ builds the gem and pushes it to rubygems.org
49
+ }
50
+ task :push => :build do
54
51
 
55
- # gemspec spec : http://www.rubygems.org/read/chapter/20
52
+ sh "gem push pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
56
53
  end
57
- Jeweler::GemcutterTasks.new
58
54
 
59
55
 
60
56
  #
61
- # DOC
62
-
57
+ # rdoc
63
58
  #
64
59
  # make sure to have rdoc 2.5.x to run that
65
- #
66
- require 'rake/rdoctask'
60
+
67
61
  Rake::RDocTask.new do |rd|
68
62
 
69
- rd.main = 'README.rdoc'
70
- rd.rdoc_dir = 'rdoc/rufus-scheduler'
71
- rd.title = "rufus-scheduler #{Rufus::Scheduler::VERSION}"
63
+ rd.main = 'README.txt'
64
+ rd.rdoc_dir = "rdoc/#{GEMSPEC.name}"
65
+
66
+ rd.rdoc_files.include('README.rdoc', 'CHANGELOG.txt', 'lib/**/*.rb')
72
67
 
73
- rd.rdoc_files.include(
74
- 'README.rdoc', 'CHANGELOG.txt', 'LICENSE.txt', 'CREDITS.txt', 'lib/**/*.rb')
68
+ rd.title = "#{GEMSPEC.name} #{GEMSPEC.version}"
75
69
  end
76
70
 
77
71
 
78
72
  #
79
- # TO THE WEB
73
+ # upload_rdoc
80
74
 
75
+ desc %{
76
+ upload the rdoc to rubyforge
77
+ }
81
78
  task :upload_rdoc => [ :clean, :rdoc ] do
82
79
 
83
80
  account = 'jmettraux@rubyforge.org'
84
- webdir = '/var/www/gforge-projects/rufus'
81
+ webdir = "/var/www/gforge-projects/rufus"
85
82
 
86
- sh "rsync -azv -e ssh rdoc/rufus-scheduler #{account}:#{webdir}/"
83
+ sh "rsync -azv -e ssh rdoc/#{GEMSPEC.name} #{account}:#{webdir}/"
87
84
  end
88
85
 
data/dump.txt ADDED
@@ -0,0 +1,18 @@
1
+
2
+ jmettraux@sanma ~/tmp/billen/bill 円 script/server
3
+ => Booting WEBrick
4
+ => Rails 2.3.10 application starting on http://0.0.0.0:3000
5
+ => Call with -d to detach
6
+ => Ctrl-C to shutdown server
7
+ [2010-12-15 09:41:55] INFO WEBrick 1.3.1
8
+ [2010-12-15 09:41:55] INFO ruby 1.8.7 (2010-04-19) [i686-darwin10.5.0]
9
+ [2010-12-15 09:41:55] INFO WEBrick::HTTPServer#start: pid=15393 port=3000
10
+ "Wed Dec 15 09:43:00 +0900 2010 - run 0"
11
+ "Wed Dec 15 10:43:00 +0900 2010 - run 1"
12
+ "Wed Dec 15 11:43:00 +0900 2010 - run 2"
13
+ "Wed Dec 15 12:43:00 +0900 2010 - run 3"
14
+ "Wed Dec 15 13:43:00 +0900 2010 - run 4"
15
+ "Wed Dec 15 14:43:00 +0900 2010 - run 5"
16
+ "Wed Dec 15 15:43:00 +0900 2010 - run 6"
17
+ "Wed Dec 15 16:43:00 +0900 2010 - run 7"
18
+
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2006-2011, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -224,7 +224,7 @@ module Rufus
224
224
  istart = Integer(item[0..i - 1])
225
225
 
226
226
  if j
227
- iend = Integer(item[i + 1..j])
227
+ iend = Integer(item[i + 1..j - 1])
228
228
  else
229
229
  iend = Integer(item[i + 1..-1])
230
230
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2006-2011, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -103,8 +103,9 @@ module Scheduler
103
103
 
104
104
  def delete(job_id)
105
105
 
106
- j = @jobs.find { |j| j.job_id == job_id }
107
- @jobs.delete(j) if j
106
+ if job = @jobs.find { |j| j.job_id == job_id }
107
+ @jobs.delete(job)
108
+ end
108
109
  end
109
110
 
110
111
  # Returns the next job to trigger. Returns nil if none eligible.
data/lib/rufus/sc/jobs.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2006-2011, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005-2010, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2006-2011, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
2
+ # Copyright (c) 2006-2011, John Mettraux, jmettraux@gmail.com
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,7 @@
26
26
  module Rufus
27
27
  module Scheduler
28
28
 
29
- VERSION = '2.0.7'
29
+ VERSION = '2.0.8'
30
30
  end
31
31
  end
32
32
 
@@ -1,107 +1,32 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
5
2
 
6
3
  Gem::Specification.new do |s|
7
- s.name = %q{rufus-scheduler}
8
- s.version = "2.0.7"
9
4
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["John Mettraux"]
12
- s.date = %q{2010-11-09}
13
- s.description = %q{
14
- job scheduler for Ruby (at, cron, in and every jobs).
5
+ s.name = 'rufus-scheduler'
6
+ s.version = File.read('lib/rufus/sc/version.rb').match(/VERSION = '([^']+)'/)[1]
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = [ 'John Mettraux' ]
9
+ s.email = [ 'jmettraux@gmail.com' ]
10
+ s.homepage = 'http://github.com/jmettraux/rufus-scheduler'
11
+ s.rubyforge_project = 'rufus'
12
+ s.summary = 'job scheduler for Ruby (at, cron, in and every jobs)'
15
13
 
16
- By default uses a Ruby thread, if EventMachine is present, it will rely on it.
17
- }
18
- s.email = %q{jmettraux@gmail.com}
19
- s.extra_rdoc_files = [
20
- "LICENSE.txt",
21
- "README.rdoc"
22
- ]
23
- s.files = [
24
- ".gitignore",
25
- ".rspec",
26
- "CHANGELOG.txt",
27
- "CREDITS.txt",
28
- "LICENSE.txt",
29
- "README.rdoc",
30
- "Rakefile",
31
- "TODO.txt",
32
- "lib/rufus-scheduler.rb",
33
- "lib/rufus/otime.rb",
34
- "lib/rufus/sc/cronline.rb",
35
- "lib/rufus/sc/jobqueues.rb",
36
- "lib/rufus/sc/jobs.rb",
37
- "lib/rufus/sc/rtime.rb",
38
- "lib/rufus/sc/scheduler.rb",
39
- "lib/rufus/sc/version.rb",
40
- "lib/rufus/scheduler.rb",
41
- "misc/cronline_next_time_cost.rb",
42
- "rufus-scheduler.gemspec",
43
- "spec/at_in_spec.rb",
44
- "spec/at_spec.rb",
45
- "spec/blocking_spec.rb",
46
- "spec/cron_spec.rb",
47
- "spec/cronline_spec.rb",
48
- "spec/every_spec.rb",
49
- "spec/exception_spec.rb",
50
- "spec/in_spec.rb",
51
- "spec/rtime_spec.rb",
52
- "spec/schedulable_spec.rb",
53
- "spec/scheduler_spec.rb",
54
- "spec/spec_base.rb",
55
- "spec/stress_schedule_unschedule_spec.rb",
56
- "spec/timeout_spec.rb",
57
- "test/kjw.rb",
58
- "test/t.rb"
59
- ]
60
- s.homepage = %q{http://github.com/jmettraux/rufus-scheduler/}
61
- s.rdoc_options = ["--charset=UTF-8"]
62
- s.require_paths = ["lib"]
63
- s.rubyforge_project = %q{rufus}
64
- s.rubygems_version = %q{1.3.7}
65
- s.summary = %q{job scheduler for Ruby (at, cron, in and every jobs)}
66
- s.test_files = [
67
- "spec/at_in_spec.rb",
68
- "spec/at_spec.rb",
69
- "spec/blocking_spec.rb",
70
- "spec/cron_spec.rb",
71
- "spec/cronline_spec.rb",
72
- "spec/every_spec.rb",
73
- "spec/exception_spec.rb",
74
- "spec/in_spec.rb",
75
- "spec/rtime_spec.rb",
76
- "spec/schedulable_spec.rb",
77
- "spec/scheduler_spec.rb",
78
- "spec/spec_base.rb",
79
- "spec/stress_schedule_unschedule_spec.rb",
80
- "spec/timeout_spec.rb",
81
- "test/kjw.rb",
82
- "test/t.rb"
14
+ s.description = %{
15
+ job scheduler for Ruby (at, cron, in and every jobs).
16
+ }.strip
17
+
18
+ #s.files = `git ls-files`.split("\n")
19
+ s.files = Dir[
20
+ 'Rakefile',
21
+ 'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb',
22
+ '*.gemspec', '*.txt', '*.rdoc', '*.md'
83
23
  ]
84
24
 
85
- if s.respond_to? :specification_version then
86
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
87
- s.specification_version = 3
25
+ s.add_runtime_dependency 'tzinfo', '>= 0.3.23'
26
+
27
+ s.add_development_dependency 'rake'
28
+ s.add_development_dependency 'rspec', '>= 2.0'
88
29
 
89
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
90
- s.add_runtime_dependency(%q<tzinfo>, [">= 0"])
91
- s.add_development_dependency(%q<rake>, [">= 0"])
92
- s.add_development_dependency(%q<rspec>, [">= 0"])
93
- s.add_development_dependency(%q<jeweler>, [">= 0"])
94
- else
95
- s.add_dependency(%q<tzinfo>, [">= 0"])
96
- s.add_dependency(%q<rake>, [">= 0"])
97
- s.add_dependency(%q<rspec>, [">= 0"])
98
- s.add_dependency(%q<jeweler>, [">= 0"])
99
- end
100
- else
101
- s.add_dependency(%q<tzinfo>, [">= 0"])
102
- s.add_dependency(%q<rake>, [">= 0"])
103
- s.add_dependency(%q<rspec>, [">= 0"])
104
- s.add_dependency(%q<jeweler>, [">= 0"])
105
- end
30
+ s.require_path = 'lib'
106
31
  end
107
32
 
@@ -59,6 +59,19 @@ describe Rufus::CronLine do
59
59
  lambda { cl '* * * * * NotATimeZone' }.should raise_error
60
60
  lambda { cl '* * * * * * NotATimeZone' }.should raise_error
61
61
  end
62
+
63
+ it 'interprets cron strings with / (slashes) correctly' do
64
+
65
+ to_a(
66
+ '0 */2 * * *',
67
+ [[0], [0], [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24], nil, nil, nil, nil])
68
+ to_a(
69
+ '0 7-23/2 * * *',
70
+ [[0], [0], [7, 9, 11, 13, 15, 17, 19, 21, 23], nil, nil, nil, nil])
71
+ to_a(
72
+ '*/10 * * * *',
73
+ [[0], [0, 10, 20, 30, 40, 50], nil, nil, nil, nil, nil])
74
+ end
62
75
  end
63
76
 
64
77
  describe '#next_time' do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 7
9
- version: 2.0.7
8
+ - 8
9
+ version: 2.0.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Mettraux
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-09 00:00:00 +09:00
17
+ date: 2010-12-31 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,7 +27,9 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  segments:
29
29
  - 0
30
- version: "0"
30
+ - 3
31
+ - 23
32
+ version: 0.3.23
31
33
  type: :runtime
32
34
  version_requirements: *id001
33
35
  - !ruby/object:Gem::Dependency
@@ -52,42 +54,22 @@ dependencies:
52
54
  - - ">="
53
55
  - !ruby/object:Gem::Version
54
56
  segments:
57
+ - 2
55
58
  - 0
56
- version: "0"
59
+ version: "2.0"
57
60
  type: :development
58
61
  version_requirements: *id003
59
- - !ruby/object:Gem::Dependency
60
- name: jeweler
61
- prerelease: false
62
- requirement: &id004 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- segments:
68
- - 0
69
- version: "0"
70
- type: :development
71
- version_requirements: *id004
72
- description: "\n job scheduler for Ruby (at, cron, in and every jobs).\n\n By default uses a Ruby thread, if EventMachine is present, it will rely on it.\n "
73
- email: jmettraux@gmail.com
62
+ description: job scheduler for Ruby (at, cron, in and every jobs).
63
+ email:
64
+ - jmettraux@gmail.com
74
65
  executables: []
75
66
 
76
67
  extensions: []
77
68
 
78
- extra_rdoc_files:
79
- - LICENSE.txt
80
- - README.rdoc
69
+ extra_rdoc_files: []
70
+
81
71
  files:
82
- - .gitignore
83
- - .rspec
84
- - CHANGELOG.txt
85
- - CREDITS.txt
86
- - LICENSE.txt
87
- - README.rdoc
88
72
  - Rakefile
89
- - TODO.txt
90
- - lib/rufus-scheduler.rb
91
73
  - lib/rufus/otime.rb
92
74
  - lib/rufus/sc/cronline.rb
93
75
  - lib/rufus/sc/jobqueues.rb
@@ -96,8 +78,7 @@ files:
96
78
  - lib/rufus/sc/scheduler.rb
97
79
  - lib/rufus/sc/version.rb
98
80
  - lib/rufus/scheduler.rb
99
- - misc/cronline_next_time_cost.rb
100
- - rufus-scheduler.gemspec
81
+ - lib/rufus-scheduler.rb
101
82
  - spec/at_in_spec.rb
102
83
  - spec/at_spec.rb
103
84
  - spec/blocking_spec.rb
@@ -114,13 +95,20 @@ files:
114
95
  - spec/timeout_spec.rb
115
96
  - test/kjw.rb
116
97
  - test/t.rb
98
+ - rufus-scheduler.gemspec
99
+ - CHANGELOG.txt
100
+ - CREDITS.txt
101
+ - LICENSE.txt
102
+ - TODO.txt
103
+ - dump.txt
104
+ - README.rdoc
117
105
  has_rdoc: true
118
- homepage: http://github.com/jmettraux/rufus-scheduler/
106
+ homepage: http://github.com/jmettraux/rufus-scheduler
119
107
  licenses: []
120
108
 
121
109
  post_install_message:
122
- rdoc_options:
123
- - --charset=UTF-8
110
+ rdoc_options: []
111
+
124
112
  require_paths:
125
113
  - lib
126
114
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -146,20 +134,5 @@ rubygems_version: 1.3.7
146
134
  signing_key:
147
135
  specification_version: 3
148
136
  summary: job scheduler for Ruby (at, cron, in and every jobs)
149
- test_files:
150
- - spec/at_in_spec.rb
151
- - spec/at_spec.rb
152
- - spec/blocking_spec.rb
153
- - spec/cron_spec.rb
154
- - spec/cronline_spec.rb
155
- - spec/every_spec.rb
156
- - spec/exception_spec.rb
157
- - spec/in_spec.rb
158
- - spec/rtime_spec.rb
159
- - spec/schedulable_spec.rb
160
- - spec/scheduler_spec.rb
161
- - spec/spec_base.rb
162
- - spec/stress_schedule_unschedule_spec.rb
163
- - spec/timeout_spec.rb
164
- - test/kjw.rb
165
- - test/t.rb
137
+ test_files: []
138
+
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- .rvmrc
2
- rdoc
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --colour --format documentation
@@ -1,14 +0,0 @@
1
-
2
- $:.unshift('lib')
3
- require 'rufus/scheduler'
4
-
5
- loop do
6
-
7
- print "> "
8
- s = gets
9
-
10
- t = Time.now
11
- puts Rufus::CronLine.new(s).next_time
12
- puts "took #{Time.now - t} secs"
13
- end
14
-