javan-whenever 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/README.rdoc +48 -14
- data/lib/version.rb +1 -1
- data/lib/whenever.rb +3 -7
- data/whenever.gemspec +2 -2
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -14,7 +14,7 @@ In a Rails (2.1 or greater) application:
|
|
14
14
|
in your "config/environment.rb" file:
|
15
15
|
|
16
16
|
Rails::Initializer.run do |config|
|
17
|
-
config.gem 'javan-whenever', :lib => false, :version => '>= 0.1.
|
17
|
+
config.gem 'javan-whenever', :lib => false, :version => '>= 0.1.5' :source => 'http://gems.github.com'
|
18
18
|
end
|
19
19
|
|
20
20
|
To install this gem (and all other missing gem dependencies), run rake gems:install (use sudo if necessary).
|
@@ -43,18 +43,14 @@ This will create an initial "config/schedule.rb" file you.
|
|
43
43
|
|
44
44
|
== Example schedule.rb file
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
every 2.hours do
|
51
|
-
runner "MyModel.some_process" # runners are the script/runners you know and love
|
52
|
-
rake "my:rake:task" # conveniently run rake tasks
|
53
|
-
command "/usr/bin/my_great_command" # commands are any unix command
|
46
|
+
every 3.hours do
|
47
|
+
runner "MyModel.some_process"
|
48
|
+
rake "my:rake:task"
|
49
|
+
command "/usr/bin/my_great_command"
|
54
50
|
end
|
55
51
|
|
56
|
-
every 1.day, :at => '4:30 am' do
|
57
|
-
runner "DB.Backup"
|
52
|
+
every 1.day, :at => '4:30 am' do
|
53
|
+
runner "DB.Backup"
|
58
54
|
end
|
59
55
|
|
60
56
|
every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
|
@@ -64,6 +60,8 @@ This will create an initial "config/schedule.rb" file you.
|
|
64
60
|
every :sunday do # Use any day of the week or :weekend, :weekday
|
65
61
|
runner "Task.do_something_great"
|
66
62
|
end
|
63
|
+
|
64
|
+
More examples on the wiki: http://wiki.github.com/javan/whenever/instructions-and-examples
|
67
65
|
|
68
66
|
== Cron output
|
69
67
|
|
@@ -85,7 +83,43 @@ in your "config/deploy.rb" file do something like:
|
|
85
83
|
end
|
86
84
|
end
|
87
85
|
|
88
|
-
|
89
|
-
|
86
|
+
By mixing and matching the "--load-file" and "--user" options with your various :roles in Capistrano it is entirely possible to deploy different crontab schedules under different users to all your various servers. Get creative!
|
87
|
+
|
88
|
+
USING THE "--write-crontab" OPTION WILL COMPLETELY OVERWRITE ANY EXISTING CRONTAB ENTRIES!
|
89
|
+
|
90
|
+
== Credit
|
91
|
+
|
92
|
+
Whenever was created for use at Inkling (http://inklingmarkets.com) where I work.
|
93
|
+
|
94
|
+
While building Whenever, I learned a lot by digging through the source code of Capistrano - http://github.com/jamis/capistrano
|
95
|
+
|
96
|
+
== Feedback
|
97
|
+
|
98
|
+
Lighthouse: http://javan.lighthouseapp.com/projects/25781-whenever/overview
|
99
|
+
|
100
|
+
Email me: javan [at] javan (dot) us
|
101
|
+
|
102
|
+
== License
|
103
|
+
|
104
|
+
Copyright (c) 2009 Javan Makhmali
|
105
|
+
|
106
|
+
Permission is hereby granted, free of charge, to any person
|
107
|
+
obtaining a copy of this software and associated documentation
|
108
|
+
files (the "Software"), to deal in the Software without
|
109
|
+
restriction, including without limitation the rights to use,
|
110
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
111
|
+
copies of the Software, and to permit persons to whom the
|
112
|
+
Software is furnished to do so, subject to the following
|
113
|
+
conditions:
|
114
|
+
|
115
|
+
The above copyright notice and this permission notice shall be
|
116
|
+
included in all copies or substantial portions of the Software.
|
90
117
|
|
91
|
-
|
118
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
119
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
120
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
121
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
122
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
123
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
124
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
125
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/version.rb
CHANGED
data/lib/whenever.rb
CHANGED
@@ -14,10 +14,6 @@ require 'activesupport'
|
|
14
14
|
require 'chronic'
|
15
15
|
|
16
16
|
# Whenever files
|
17
|
-
|
18
|
-
require
|
19
|
-
|
20
|
-
require 'job_types/default'
|
21
|
-
require 'job_types/rake_task'
|
22
|
-
require 'job_types/runner'
|
23
|
-
require 'outputs/cron'
|
17
|
+
%w{ base version job_list job_types/default job_types/rake_task job_types/runner outputs/cron }.each do |file|
|
18
|
+
require File.expand_path(File.dirname(__FILE__) + "/#{file}")
|
19
|
+
end
|
data/whenever.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{whenever}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Javan Makhmali"]
|
9
|
-
s.date = %q{2009-02-
|
9
|
+
s.date = %q{2009-02-19}
|
10
10
|
s.description = %q{Provides clean ruby syntax for defining messy cron jobs and running them Whenever.}
|
11
11
|
s.email = %q{javan@javan.us}
|
12
12
|
s.executables = ["whenever", "wheneverize"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: javan-whenever
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javan Makhmali
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-19 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|