clockwork 0.3.3 → 0.3.4
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/VERSION +1 -1
- data/lib/clockwork.rb +6 -7
- metadata +3 -8
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/lib/clockwork.rb
CHANGED
@@ -4,10 +4,7 @@ module Clockwork
|
|
4
4
|
|
5
5
|
class At
|
6
6
|
class FailedToParse < StandardError; end;
|
7
|
-
NOT_SPECIFIED =
|
8
|
-
include Comparable
|
9
|
-
def <=>(other); 0; end # equals to anything
|
10
|
-
end
|
7
|
+
NOT_SPECIFIED = nil
|
11
8
|
WDAYS = %w[sunday monday tuesday wednesday thursday friday saturday].map do |w|
|
12
9
|
[w, w.capitalize, w[0...3], w[0...3].capitalize]
|
13
10
|
end
|
@@ -36,8 +33,8 @@ module Clockwork
|
|
36
33
|
|
37
34
|
def initialize(min, hour=NOT_SPECIFIED, wday=NOT_SPECIFIED)
|
38
35
|
if min.nil? || min < 0 || min > 59 ||
|
39
|
-
hour < 0 || hour > 23 ||
|
40
|
-
wday < 0 || wday > 6
|
36
|
+
(hour != NOT_SPECIFIED && (hour < 0 || hour > 23)) ||
|
37
|
+
(wday != NOT_SPECIFIED && (wday < 0 || wday > 6))
|
41
38
|
raise ArgumentError
|
42
39
|
end
|
43
40
|
@min = min
|
@@ -46,7 +43,9 @@ module Clockwork
|
|
46
43
|
end
|
47
44
|
|
48
45
|
def ready?(t)
|
49
|
-
t.min == @min and
|
46
|
+
t.min == @min and
|
47
|
+
(@hour == NOT_SPECIFIED or t.hour == @hour) and
|
48
|
+
(@wday == NOT_SPECIFIED or t.wday == @wday)
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: clockwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Adam Wiggins
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-12-
|
14
|
-
default_executable: clockwork
|
13
|
+
date: 2011-12-14 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: jeweler
|
@@ -63,7 +62,6 @@ files:
|
|
63
62
|
- bin/clockwork
|
64
63
|
- lib/clockwork.rb
|
65
64
|
- test/clockwork_test.rb
|
66
|
-
has_rdoc: true
|
67
65
|
homepage: http://github.com/adamwiggins/clockwork
|
68
66
|
licenses: []
|
69
67
|
|
@@ -77,9 +75,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
75
|
requirements:
|
78
76
|
- - ">="
|
79
77
|
- !ruby/object:Gem::Version
|
80
|
-
hash: -31480467
|
81
|
-
segments:
|
82
|
-
- 0
|
83
78
|
version: "0"
|
84
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
80
|
none: false
|
@@ -90,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
85
|
requirements: []
|
91
86
|
|
92
87
|
rubyforge_project: clockwork
|
93
|
-
rubygems_version: 1.
|
88
|
+
rubygems_version: 1.8.6
|
94
89
|
signing_key:
|
95
90
|
specification_version: 3
|
96
91
|
summary: A scheduler process to replace cron.
|