clockwork 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +17 -2
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. metadata +75 -59
data/README.md CHANGED
@@ -125,6 +125,21 @@ You can also specify a timezone (default is the local timezone):
125
125
  # Runs the job each day at midnight, UTC.
126
126
  # The value for :tz can be anything supported by [TZInfo](http://tzinfo.rubyforge.org/)
127
127
 
128
+ ### :if
129
+
130
+ `:if` parameter is invoked every time the task is ready to run, and run if the
131
+ return value is true.
132
+
133
+ Run on every first day of month.
134
+
135
+ Clockwork.every(1.day, 'myjob', :if => lambda { |t| t.day == 1 })
136
+
137
+ The argument is an instance of `Time`. If `:tz` option is set, it is local time.
138
+
139
+ This argument cannot be omitted. Please use _ as placeholder if not needed.
140
+
141
+ Clockwork.every(1.second, 'myjob', :if => lambda { |_| true })
142
+
128
143
 
129
144
  Configuration
130
145
  -----------------------
@@ -215,7 +230,7 @@ Meta
215
230
 
216
231
  Created by Adam Wiggins
217
232
 
218
- Inspired by [rufus-scheduler](http://rufus.rubyforge.org/rufus-scheduler/) and [http://github.com/bvandenbos/resque-scheduler](resque-scehduler)
233
+ Inspired by [rufus-scheduler](http://rufus.rubyforge.org/rufus-scheduler/) and [resque-scehduler](http://github.com/bvandenbos/resque-scheduler)
219
234
 
220
235
  Design assistance from Peter van Hardenberg and Matthew Soldo
221
236
 
@@ -223,5 +238,5 @@ Patches contributed by Mark McGranaghan and Lukáš Konarovský
223
238
 
224
239
  Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
225
240
 
226
- http://github.com/adamwiggins/clockwork
241
+ http://github.com/tomykaira/clockwork
227
242
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ Jeweler::Tasks.new do |s|
6
6
  s.description = "A scheduler process to replace cron, using a more flexible Ruby syntax running as a single long-running process. Inspired by rufus-scheduler and resque-scheduler."
7
7
  s.author = "Adam Wiggins"
8
8
  s.email = "adam@heroku.com"
9
- s.homepage = "http://github.com/adamwiggins/clockwork"
9
+ s.homepage = "http://github.com/tomykaira/clockwork"
10
10
  s.executables = [ "clockwork" ]
11
11
  s.rubyforge_project = "clockwork"
12
12
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
metadata CHANGED
@@ -1,70 +1,89 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: clockwork
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.1
4
5
  prerelease:
5
- version: 0.4.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Adam Wiggins
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-03-31 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-07-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: tzinfo
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
27
31
  name: jeweler
28
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
29
33
  none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
38
47
  name: contest
39
- requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
40
49
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
45
54
  type: :development
46
55
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
49
63
  name: mocha
50
- requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
51
65
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  type: :development
57
71
  prerelease: false
58
- version_requirements: *id004
59
- description: A scheduler process to replace cron, using a more flexible Ruby syntax running as a single long-running process. Inspired by rufus-scheduler and resque-scheduler.
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: A scheduler process to replace cron, using a more flexible Ruby syntax
79
+ running as a single long-running process. Inspired by rufus-scheduler and resque-scheduler.
60
80
  email: adam@heroku.com
61
- executables:
81
+ executables:
62
82
  - clockwork
63
83
  extensions: []
64
-
65
- extra_rdoc_files:
84
+ extra_rdoc_files:
66
85
  - README.md
67
- files:
86
+ files:
68
87
  - Gemfile
69
88
  - Gemfile.lock
70
89
  - README.md
@@ -73,35 +92,32 @@ files:
73
92
  - bin/clockwork
74
93
  - lib/clockwork.rb
75
94
  - test/clockwork_test.rb
76
- homepage: http://github.com/adamwiggins/clockwork
95
+ homepage: http://github.com/tomykaira/clockwork
77
96
  licenses: []
78
-
79
97
  post_install_message:
80
98
  rdoc_options: []
81
-
82
- require_paths:
99
+ require_paths:
83
100
  - lib
84
- required_ruby_version: !ruby/object:Gem::Requirement
101
+ required_ruby_version: !ruby/object:Gem::Requirement
85
102
  none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- hash: -383118451
90
- segments:
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ segments:
91
108
  - 0
92
- version: "0"
93
- required_rubygems_version: !ruby/object:Gem::Requirement
109
+ hash: -324134193
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
111
  none: false
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: "0"
112
+ requirements:
113
+ - - ! '>='
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
99
116
  requirements: []
100
-
101
117
  rubyforge_project: clockwork
102
- rubygems_version: 1.8.17
118
+ rubygems_version: 1.8.24
103
119
  signing_key:
104
120
  specification_version: 3
105
121
  summary: A scheduler process to replace cron.
106
- test_files:
122
+ test_files:
107
123
  - test/clockwork_test.rb