rufus-scheduler 2.0.4 → 2.0.5
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.
- data/CHANGELOG.txt +5 -0
- data/CREDITS.txt +1 -0
- data/Rakefile +1 -1
- data/lib/rufus/sc/rtime.rb +5 -0
- data/lib/rufus/sc/scheduler.rb +1 -4
- data/lib/rufus/sc/version.rb +32 -0
- data/rufus-scheduler.gemspec +4 -3
- data/spec/rtime_spec.rb +5 -0
- metadata +31 -17
data/CHANGELOG.txt
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
= rufus-scheduler CHANGELOG.txt
|
3
3
|
|
4
4
|
|
5
|
+
== rufus-scheduler - 2.0.5 released 2010/03/02
|
6
|
+
|
7
|
+
- fixed parse_time_string(s) issue, thanks Gonzalo Suarez
|
8
|
+
|
9
|
+
|
5
10
|
== rufus-scheduler - 2.0.4 released 2010/02/12
|
6
11
|
|
7
12
|
- addressing issue with every and timeout, thanks Tony Day
|
data/CREDITS.txt
CHANGED
data/Rakefile
CHANGED
data/lib/rufus/sc/rtime.rb
CHANGED
@@ -80,6 +80,8 @@ module Rufus
|
|
80
80
|
(Time.new.to_f * 1000).to_i
|
81
81
|
end
|
82
82
|
|
83
|
+
FLOAT_DURATION = /^\d*\.\d*$/
|
84
|
+
|
83
85
|
# Turns a string like '1m10s' into a float like '70.0', more formally,
|
84
86
|
# turns a time duration expressed as a string into a Float instance
|
85
87
|
# (millisecond count).
|
@@ -95,6 +97,7 @@ module Rufus
|
|
95
97
|
#
|
96
98
|
# Some examples :
|
97
99
|
#
|
100
|
+
# Rufus.parse_time_string "0.5" # => 0.5
|
98
101
|
# Rufus.parse_time_string "500" # => 0.5
|
99
102
|
# Rufus.parse_time_string "1000" # => 1.0
|
100
103
|
# Rufus.parse_time_string "1h" # => 3600.0
|
@@ -103,6 +106,8 @@ module Rufus
|
|
103
106
|
#
|
104
107
|
def Rufus.parse_time_string (string)
|
105
108
|
|
109
|
+
return string.to_f if FLOAT_DURATION.match(string)
|
110
|
+
|
106
111
|
string = string.strip
|
107
112
|
|
108
113
|
index = -1
|
data/lib/rufus/sc/scheduler.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
#++
|
24
24
|
|
25
25
|
|
26
|
+
require 'rufus/sc/version'
|
26
27
|
require 'rufus/sc/rtime'
|
27
28
|
require 'rufus/sc/cronline'
|
28
29
|
require 'rufus/sc/jobs'
|
@@ -31,10 +32,6 @@ require 'rufus/sc/jobqueues'
|
|
31
32
|
|
32
33
|
module Rufus::Scheduler
|
33
34
|
|
34
|
-
# This gem's version
|
35
|
-
#
|
36
|
-
VERSION = '2.0.4'
|
37
|
-
|
38
35
|
#
|
39
36
|
# It's OK to pass an object responding to :trigger when scheduling a job
|
40
37
|
# (instead of passing a block).
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
|
+
|
25
|
+
|
26
|
+
module Rufus
|
27
|
+
module Scheduler
|
28
|
+
|
29
|
+
VERSION = '2.0.5'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
data/rufus-scheduler.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rufus-scheduler}
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["John Mettraux"]
|
12
|
-
s.date = %q{2010-02
|
12
|
+
s.date = %q{2010-03-02}
|
13
13
|
s.description = %q{
|
14
14
|
job scheduler for Ruby (at, cron, in and every jobs).
|
15
15
|
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/rufus/sc/jobs.rb",
|
35
35
|
"lib/rufus/sc/rtime.rb",
|
36
36
|
"lib/rufus/sc/scheduler.rb",
|
37
|
+
"lib/rufus/sc/version.rb",
|
37
38
|
"lib/rufus/scheduler.rb",
|
38
39
|
"misc/cronline_next_time_cost.rb",
|
39
40
|
"rufus-scheduler.gemspec",
|
@@ -59,7 +60,7 @@ Gem::Specification.new do |s|
|
|
59
60
|
s.rdoc_options = ["--charset=UTF-8"]
|
60
61
|
s.require_paths = ["lib"]
|
61
62
|
s.rubyforge_project = %q{rufus}
|
62
|
-
s.rubygems_version = %q{1.3.
|
63
|
+
s.rubygems_version = %q{1.3.6}
|
63
64
|
s.summary = %q{job scheduler for Ruby (at, cron, in and every jobs)}
|
64
65
|
s.test_files = [
|
65
66
|
"spec/spec.rb"
|
data/spec/rtime_spec.rb
CHANGED
@@ -24,8 +24,13 @@ describe 'rufus/otime' do
|
|
24
24
|
|
25
25
|
it 'should parse duration strings' do
|
26
26
|
|
27
|
+
pts('5.0').should.equal(5.0)
|
28
|
+
pts('0.5').should.equal(0.5)
|
29
|
+
pts('.5').should.equal(0.5)
|
30
|
+
pts('5.').should.equal(5.0)
|
27
31
|
pts('500').should.equal(0.5)
|
28
32
|
pts('1000').should.equal(1.0)
|
33
|
+
pts('1').should.equal(0.001)
|
29
34
|
pts('1s').should.equal(1.0)
|
30
35
|
pts('1h').should.equal(3600.0)
|
31
36
|
pts('1h10s').should.equal(3610.0)
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rufus-scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
version: 2.0.5
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- John Mettraux
|
@@ -9,39 +14,45 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-02
|
17
|
+
date: 2010-03-02 00:00:00 +09:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: yard
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :development
|
31
|
+
version_requirements: *id001
|
25
32
|
- !ruby/object:Gem::Dependency
|
26
33
|
name: bacon
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
33
41
|
version: "0"
|
34
|
-
|
42
|
+
type: :development
|
43
|
+
version_requirements: *id002
|
35
44
|
- !ruby/object:Gem::Dependency
|
36
45
|
name: jeweler
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
prerelease: false
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
48
|
requirements:
|
41
49
|
- - ">="
|
42
50
|
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
43
53
|
version: "0"
|
44
|
-
|
54
|
+
type: :development
|
55
|
+
version_requirements: *id003
|
45
56
|
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 "
|
46
57
|
email: jmettraux@gmail.com
|
47
58
|
executables: []
|
@@ -65,6 +76,7 @@ files:
|
|
65
76
|
- lib/rufus/sc/jobs.rb
|
66
77
|
- lib/rufus/sc/rtime.rb
|
67
78
|
- lib/rufus/sc/scheduler.rb
|
79
|
+
- lib/rufus/sc/version.rb
|
68
80
|
- lib/rufus/scheduler.rb
|
69
81
|
- misc/cronline_next_time_cost.rb
|
70
82
|
- rufus-scheduler.gemspec
|
@@ -98,18 +110,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
110
|
requirements:
|
99
111
|
- - ">="
|
100
112
|
- !ruby/object:Gem::Version
|
113
|
+
segments:
|
114
|
+
- 0
|
101
115
|
version: "0"
|
102
|
-
version:
|
103
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
117
|
requirements:
|
105
118
|
- - ">="
|
106
119
|
- !ruby/object:Gem::Version
|
120
|
+
segments:
|
121
|
+
- 0
|
107
122
|
version: "0"
|
108
|
-
version:
|
109
123
|
requirements: []
|
110
124
|
|
111
125
|
rubyforge_project: rufus
|
112
|
-
rubygems_version: 1.3.
|
126
|
+
rubygems_version: 1.3.6
|
113
127
|
signing_key:
|
114
128
|
specification_version: 3
|
115
129
|
summary: job scheduler for Ruby (at, cron, in and every jobs)
|