whenever 0.5.3 → 0.6.2

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/whenever.gemspec CHANGED
@@ -5,32 +5,32 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whenever}
8
- s.version = "0.5.3"
8
+ s.version = "0.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Javan Makhmali"]
12
- s.date = %q{2010-09-24}
13
- s.description = %q{Clean ruby syntax for defining and deploying messy cron jobs.}
12
+ s.date = %q{2010-10-26}
13
+ s.description = %q{Clean ruby syntax for writing and deploying cron jobs.}
14
14
  s.email = %q{javan@javan.us}
15
15
  s.executables = ["whenever", "wheneverize"]
16
16
  s.extra_rdoc_files = [
17
- "README.rdoc"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".gitignore",
21
- "CHANGELOG.rdoc",
22
- "README.rdoc",
21
+ "CHANGELOG.md",
22
+ "README.md",
23
23
  "Rakefile",
24
24
  "bin/whenever",
25
25
  "bin/wheneverize",
26
26
  "lib/whenever.rb",
27
- "lib/whenever/base.rb",
27
+ "lib/whenever/capistrano.rb",
28
28
  "lib/whenever/command_line.rb",
29
29
  "lib/whenever/cron.rb",
30
30
  "lib/whenever/job.rb",
31
31
  "lib/whenever/job_list.rb",
32
- "lib/whenever/job_types/default.rb",
33
32
  "lib/whenever/output_redirection.rb",
33
+ "lib/whenever/setup.rb",
34
34
  "lib/whenever/version.rb",
35
35
  "test/functional/command_line_test.rb",
36
36
  "test/functional/output_at_test.rb",
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.rdoc_options = ["--charset=UTF-8"]
48
48
  s.require_paths = ["lib"]
49
49
  s.rubygems_version = %q{1.3.7}
50
- s.summary = %q{Clean ruby syntax for defining and deploying messy cron jobs.}
50
+ s.summary = %q{Write your cron jobs in ruby.}
51
51
  s.test_files = [
52
52
  "test/functional/command_line_test.rb",
53
53
  "test/functional/output_at_test.rb",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whenever
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 3
10
- version: 0.5.3
8
+ - 6
9
+ - 2
10
+ version: 0.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javan Makhmali
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-24 00:00:00 -04:00
18
+ date: 2010-10-26 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -82,7 +82,7 @@ dependencies:
82
82
  version: 0.9.5
83
83
  type: :development
84
84
  version_requirements: *id004
85
- description: Clean ruby syntax for defining and deploying messy cron jobs.
85
+ description: Clean ruby syntax for writing and deploying cron jobs.
86
86
  email: javan@javan.us
87
87
  executables:
88
88
  - whenever
@@ -90,22 +90,22 @@ executables:
90
90
  extensions: []
91
91
 
92
92
  extra_rdoc_files:
93
- - README.rdoc
93
+ - README.md
94
94
  files:
95
95
  - .gitignore
96
- - CHANGELOG.rdoc
97
- - README.rdoc
96
+ - CHANGELOG.md
97
+ - README.md
98
98
  - Rakefile
99
99
  - bin/whenever
100
100
  - bin/wheneverize
101
101
  - lib/whenever.rb
102
- - lib/whenever/base.rb
102
+ - lib/whenever/capistrano.rb
103
103
  - lib/whenever/command_line.rb
104
104
  - lib/whenever/cron.rb
105
105
  - lib/whenever/job.rb
106
106
  - lib/whenever/job_list.rb
107
- - lib/whenever/job_types/default.rb
108
107
  - lib/whenever/output_redirection.rb
108
+ - lib/whenever/setup.rb
109
109
  - lib/whenever/version.rb
110
110
  - test/functional/command_line_test.rb
111
111
  - test/functional/output_at_test.rb
@@ -150,7 +150,7 @@ rubyforge_project:
150
150
  rubygems_version: 1.3.7
151
151
  signing_key:
152
152
  specification_version: 3
153
- summary: Clean ruby syntax for defining and deploying messy cron jobs.
153
+ summary: Write your cron jobs in ruby.
154
154
  test_files:
155
155
  - test/functional/command_line_test.rb
156
156
  - test/functional/output_at_test.rb
data/README.rdoc DELETED
@@ -1,127 +0,0 @@
1
- == Introduction
2
-
3
- Whenever is a Ruby gem that provides a clear syntax for defining cron jobs. It outputs valid cron syntax and can even write your crontab file for you. It is designed to work well with Rails applications and can be deployed with Capistrano. Whenever works fine independently as well.
4
-
5
- Ryan Bates created a great Railscast about Whenever: http://railscasts.com/episodes/164-cron-in-ruby
6
-
7
- Discussion: http://groups.google.com/group/whenever-gem
8
-
9
- == Installation
10
-
11
- $ sudo gem install whenever
12
-
13
- == Getting started
14
-
15
- $ cd /my/rails/app
16
- $ wheneverize .
17
-
18
- This will create an initial "config/schedule.rb" file you.
19
-
20
- == Example schedule.rb file
21
-
22
- every 3.hours do
23
- runner "MyModel.some_process"
24
- rake "my:rake:task"
25
- command "/usr/bin/my_great_command"
26
- end
27
-
28
- every 1.day, :at => '4:30 am' do
29
- runner "MyModel.task_to_run_at_four_thirty_in_the_morning"
30
- end
31
-
32
- every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
33
- runner "SomeModel.ladeeda"
34
- end
35
-
36
- every :sunday, :at => '12pm' do # Use any day of the week or :weekend, :weekday
37
- runner "Task.do_something_great"
38
- end
39
-
40
- More examples on the wiki: http://wiki.github.com/javan/whenever/instructions-and-examples
41
-
42
- == Define your own job types
43
-
44
- Whenever ships with three pre-defined job types: command, runner, and rake. You can define your own with <code>job_type</code>.
45
-
46
- For example:
47
-
48
- job_type :awesome, '/usr/local/bin/awesome :task :fun_level'
49
-
50
- every 2.hours do
51
- awesome "party", :fun_level => "extreme"
52
- end
53
-
54
- Would run <code>/usr/local/bin/awesome party extreme</code> every two hours. <code>:task</code> is always replaced with the first argument, and any additional <code>:whatevers</code> are replaced with the options passed in or by variables that have been defined with <code>set</code>.
55
-
56
- The default job types that ship with Whenever are defined like so:
57
-
58
- job_type :command, ":task"
59
- job_type :runner, "cd :path && script/runner -e :environment ':task'"
60
- job_type :rake, "cd :path && RAILS_ENV=:environment /usr/bin/env rake :task"
61
-
62
- If a <code>:path</code> is not set it will default to the directory in which <code>whenever</code> was executed. <code>:environment</code> will default to 'production'.
63
-
64
- == Cron output
65
-
66
- $ cd /my/rails/app
67
- $ whenever
68
-
69
- And you'll see your schedule.rb converted to cron sytax. Note: running `whenever' with no options does not display your current crontab file, it simply shows you the output of converting your schedule.rb file.
70
-
71
- == Capistrano integration
72
-
73
- In your "config/deploy.rb" file do something like:
74
-
75
- after "deploy:symlink", "deploy:update_crontab"
76
-
77
- namespace :deploy do
78
- desc "Update the crontab file"
79
- task :update_crontab, :roles => :db do
80
- run "cd #{release_path} && whenever --update-crontab #{application}"
81
- end
82
- end
83
-
84
- This will update your crontab file, leaving any existing entries unharmed. When using the <code>--update-crontab</code> option, Whenever will only update the entries in your crontab file related to the current schedule.rb file. You can replace the <code>#{application}</code> with any identifying string you'd like. You can have any number of apps deploy to the same crontab file peacefully given they each use a different identifier.
85
-
86
- If you wish to simply overwrite your crontab file each time you deploy, use the <code>--write-crontab</code> option. This is ideal if you are only working with one app and every crontab entry is contained in a single schedule.rb file.
87
-
88
- By mixing and matching the <code>--load-file</code> and <code>--user</code> 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!
89
-
90
- If you want to override a variable (like your environment) at the time of deployment you can do so with the <code>--set</code> option: http://wiki.github.com/javan/whenever/setting-variables-on-the-fly
91
-
92
- == Credit
93
-
94
- Whenever was created for use at Inkling (http://inklingmarkets.com) where I work. Their take on it: http://blog.inklingmarkets.com/2009/02/whenever-easy-way-to-do-cron-jobs-from.html
95
-
96
- While building Whenever, I learned a lot by digging through the source code of Capistrano - http://github.com/jamis/capistrano
97
-
98
- == Discussion / Feedback / Issues / Bugs
99
-
100
- For general discussion and questions, please use the google group: http://groups.google.com/group/whenever-gem
101
-
102
- If you've found a genuine bug or issue, please use the Issues section on github: http://github.com/javan/whenever/issues
103
-
104
- == License
105
-
106
- Copyright (c) 2009+ Javan Makhmali
107
-
108
- Permission is hereby granted, free of charge, to any person
109
- obtaining a copy of this software and associated documentation
110
- files (the "Software"), to deal in the Software without
111
- restriction, including without limitation the rights to use,
112
- copy, modify, merge, publish, distribute, sublicense, and/or sell
113
- copies of the Software, and to permit persons to whom the
114
- Software is furnished to do so, subject to the following
115
- conditions:
116
-
117
- The above copyright notice and this permission notice shall be
118
- included in all copies or substantial portions of the Software.
119
-
120
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
121
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
122
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
123
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
124
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
125
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
126
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
127
- OTHER DEALINGS IN THE SOFTWARE.
data/lib/whenever/base.rb DELETED
@@ -1,11 +0,0 @@
1
- module Whenever
2
-
3
- def self.cron(options)
4
- Whenever::JobList.new(options).generate_cron_output
5
- end
6
-
7
- def self.path
8
- Dir.pwd
9
- end
10
-
11
- end
@@ -1,3 +0,0 @@
1
- job_type :command, ":task"
2
- job_type :runner, "cd :path && script/runner -e :environment ':task'"
3
- job_type :rake, "cd :path && RAILS_ENV=:environment /usr/bin/env rake :task"