javan-whenever 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,9 +1,13 @@
1
- == 0.1.1 / February 16th, 2009
1
+ == 0.1.2 / February 16th, 2009
2
2
 
3
3
  * Added 'rake' helper for defining scheduled rake tasks. [Javan Makhmali]
4
4
 
5
5
  * Renamed :cron_environment and :cron_path to :enviroment and :path for better (word) compatibility with rake tasks. [Javan Makhmali]
6
6
 
7
+ * Improved test load paths so tests can be run individually. [Javan Makhmali]
8
+
9
+ * Got rid of already initialized constant warning. [Javan Makhmali]
10
+
7
11
 
8
12
  == 0.1.0 / February 15th, 2009
9
13
 
data/README.rdoc CHANGED
@@ -1,17 +1,20 @@
1
1
  == Introduction
2
2
 
3
- Whenever is a ruby gem that provides a ruby syntax for defining cron jobs. It is designed to work well with Rails applications, but can be used independently as well.
3
+ Whenever is a ruby gem that provides a ruby 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
4
 
5
5
  == Installation
6
6
 
7
- NOTE: Requiring the whenever gem inside your Rails application is technically optional. However, if you plan to use something like Capistrano to automatically deploy and write your crontab file, you'll need to have the gem installed on your servers, and requiring it in your app is one to ensure this. If you plan to manually install the gem on your servers or you don't care about Rails, deploying, etc., you can skip the next step.
7
+ Regular (non-Rails) install:
8
+
9
+ $ gem sources -a http://gems.github.com (you only need to run this once)
10
+ $ sudo gem install javan-whenever
8
11
 
9
- To install Whenever in a Rails (2.1 or greater) application:
12
+ In a Rails (2.1 or greater) application:
10
13
 
11
14
  in your "config/environment.rb" file:
12
15
 
13
16
  Rails::Initializer.run do |config|
14
- config.gem 'javan-whenever', :lib => 'whenever', :source => 'http://gems.github.com'
17
+ config.gem 'javan-whenever', :lib => false, :version => '>= 0.1.2' :source => 'http://gems.github.com'
15
18
  end
16
19
 
17
20
  To install this gem (and all other missing gem dependencies), run rake gems:install (use sudo if necessary).
@@ -27,8 +30,10 @@ in your "config/environment.rb" file:
27
30
  ...
28
31
  end
29
32
 
30
- require "whenever"
33
+ require 'whenever'
31
34
 
35
+ NOTE: Requiring the whenever gem inside your Rails application is technically optional. However, if you plan to use something like Capistrano to automatically deploy and write your crontab file, you'll need to have the gem installed on your servers, and requiring it in your app is one to ensure this.
36
+
32
37
  == Getting started
33
38
 
34
39
  $ cd /my/rails/app
@@ -43,17 +48,17 @@ This will create an initial "config/schedule.rb" file you.
43
48
  set :cron_log, '/my/cronlog.log' # Where to log (this should NOT be your Rails log)
44
49
 
45
50
  every 2.hours do
46
- runner "MyModel.some_process" # runners are the script/runners you know and love
47
- rake "my:rake:task" # conveniently run rake tasks
48
- command "/usr/local/bin/my_great_command" # commands are any unix command
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
49
54
  end
50
55
 
51
- every 1.day, :at => '4:30 am' do # If not :at option is set these jobs will run at midnight
52
- runner "DB.Backup", :cron_log => false # You can specify false for no logging or a string a different log file to override logging.
56
+ every 1.day, :at => '4:30 am' do # If not :at option is set these jobs will run at midnight
57
+ runner "DB.Backup", :cron_log => false # You can specify false for no logging or a string with a different log file to override any global logging.
53
58
  end
54
59
 
55
60
  every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot
56
- runner "SomeModel.ladeda"
61
+ runner "SomeModel.ladeeda"
57
62
  end
58
63
 
59
64
  every :sunday do # Use any day of the week or :weekend, :weekday
data/Rakefile CHANGED
@@ -1,14 +1,16 @@
1
+ require './lib/version'
2
+
1
3
  require 'rubygems'
2
4
  require 'rake'
3
5
  require 'echoe'
4
- require 'lib/base'
5
6
 
6
- Echoe.new('whenever', Whenever::VERSION) do |p|
7
- p.description = "Provides (clean) ruby syntax for defining (messy) cron jobs and running them Whenever."
7
+ WHENEVER_VERSION = Whenever::VERSION::STRING.dup
8
+
9
+ Echoe.new('whenever', WHENEVER_VERSION) do |p|
10
+ p.changelog = "CHANGELOG.rdoc"
11
+ p.description = "Provides clean ruby syntax for defining messy cron jobs and running them Whenever."
8
12
  p.url = "http://github.com/javan/whenever"
9
13
  p.author = "Javan Makhmali"
10
14
  p.email = "javan@javan.us"
11
15
  p.dependencies = ["chronic", "activesupport"]
12
- p.ignore_pattern = ["tmp/*", "script/*"]
13
- p.development_dependencies = []
14
16
  end
data/bin/whenever CHANGED
@@ -9,7 +9,7 @@ task = "whenever:output_cron"
9
9
  OptionParser.new do |opts|
10
10
  opts.banner = "Usage: whenever [options]"
11
11
  opts.on('-c', '--write-crontab') { task = "whenever:write_cron" }
12
- opts.on('-v', '--version') { puts "Whenever v#{Whenever::VERSION}"; exit }
12
+ opts.on('-v', '--version') { puts "Whenever v#{WHENEVER_VERSION}"; exit }
13
13
  end.parse!
14
14
 
15
15
  Rake::Task[task].invoke
data/lib/base.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  module Whenever
2
- VERSION = '0.1.1'
3
2
 
4
3
  def self.cron(options)
5
4
  Whenever::JobList.new(options).generate_cron_output
@@ -12,4 +11,5 @@ module Whenever
12
11
  ::RAILS_ROOT
13
12
  end
14
13
  end
14
+
15
15
  end
data/lib/version.rb ADDED
@@ -0,0 +1,9 @@
1
+ module Whenever
2
+ module VERSION #:nodoc:
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ TINY = 2
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
data/lib/whenever.rb CHANGED
@@ -14,7 +14,6 @@ unless defined?(Whenever)
14
14
  rescue LoadError => e
15
15
  nil
16
16
  end
17
-
18
17
  end
19
18
 
20
19
 
data/test/cron_test.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + "/test_helper")
2
2
 
3
3
  class CronTest < Test::Unit::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + "/test_helper")
2
2
 
3
3
  class OutputCommandTest < Test::Unit::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + "/test_helper")
2
2
 
3
3
  class OutputEnvTest < Test::Unit::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + "/test_helper")
2
2
 
3
3
  class OutputRakeTest < Test::Unit::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + "/test_helper")
2
2
 
3
3
  class OutputRunnerTest < Test::Unit::TestCase
4
4
 
data/test/test_helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'test/unit'
3
3
 
4
+ require File.expand_path(File.dirname(__FILE__) + "/../lib/whenever")
5
+
4
6
  begin
5
7
  require 'shoulda'
6
8
  rescue LoadError
@@ -17,7 +19,6 @@ rescue LoadError
17
19
  exit(1)
18
20
  end
19
21
 
20
- require 'whenever'
21
22
 
22
23
  module TestExtensions
23
24
 
data/whenever.gemspec CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{whenever}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
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
9
  s.date = %q{2009-02-16}
10
- s.description = %q{Provides (clean) ruby syntax for defining (messy) cron jobs and running them Whenever.}
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"]
13
- s.extra_rdoc_files = ["bin/whenever", "bin/wheneverize", "CHANGELOG.rdoc", "lib/base.rb", "lib/job_list.rb", "lib/job_types/default.rb", "lib/job_types/rake_task.rb", "lib/job_types/runner.rb", "lib/outputs/cron.rb", "lib/tasks/whenever.rake", "lib/whenever.rb", "README.rdoc"]
14
- s.files = ["bin/whenever", "bin/wheneverize", "CHANGELOG.rdoc", "lib/base.rb", "lib/job_list.rb", "lib/job_types/default.rb", "lib/job_types/rake_task.rb", "lib/job_types/runner.rb", "lib/outputs/cron.rb", "lib/tasks/whenever.rake", "lib/whenever.rb", "Manifest", "Rakefile", "README.rdoc", "test/cron_test.rb", "test/output_command_test.rb", "test/output_env_test.rb", "test/output_rake_test.rb", "test/output_runner_test.rb", "test/test_helper.rb", "whenever.gemspec"]
13
+ s.extra_rdoc_files = ["bin/whenever", "bin/wheneverize", "CHANGELOG.rdoc", "lib/base.rb", "lib/job_list.rb", "lib/job_types/default.rb", "lib/job_types/rake_task.rb", "lib/job_types/runner.rb", "lib/outputs/cron.rb", "lib/tasks/whenever.rake", "lib/version.rb", "lib/whenever.rb", "README.rdoc"]
14
+ s.files = ["bin/whenever", "bin/wheneverize", "CHANGELOG.rdoc", "lib/base.rb", "lib/job_list.rb", "lib/job_types/default.rb", "lib/job_types/rake_task.rb", "lib/job_types/runner.rb", "lib/outputs/cron.rb", "lib/tasks/whenever.rake", "lib/version.rb", "lib/whenever.rb", "Manifest", "Rakefile", "README.rdoc", "test/cron_test.rb", "test/output_command_test.rb", "test/output_env_test.rb", "test/output_rake_test.rb", "test/output_runner_test.rb", "test/test_helper.rb", "whenever.gemspec"]
15
15
  s.has_rdoc = true
16
16
  s.homepage = %q{http://github.com/javan/whenever}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Whenever", "--main", "README.rdoc"]
18
18
  s.require_paths = ["lib"]
19
19
  s.rubyforge_project = %q{whenever}
20
20
  s.rubygems_version = %q{1.3.1}
21
- s.summary = %q{Provides (clean) ruby syntax for defining (messy) cron jobs and running them Whenever.}
21
+ s.summary = %q{Provides clean ruby syntax for defining messy cron jobs and running them Whenever.}
22
22
  s.test_files = ["test/cron_test.rb", "test/output_command_test.rb", "test/output_env_test.rb", "test/output_rake_test.rb", "test/output_runner_test.rb", "test/test_helper.rb"]
23
23
 
24
24
  if s.respond_to? :specification_version then
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javan Makhmali
@@ -32,7 +32,7 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: "0"
34
34
  version:
35
- description: Provides (clean) ruby syntax for defining (messy) cron jobs and running them Whenever.
35
+ description: Provides clean ruby syntax for defining messy cron jobs and running them Whenever.
36
36
  email: javan@javan.us
37
37
  executables:
38
38
  - whenever
@@ -50,6 +50,7 @@ extra_rdoc_files:
50
50
  - lib/job_types/runner.rb
51
51
  - lib/outputs/cron.rb
52
52
  - lib/tasks/whenever.rake
53
+ - lib/version.rb
53
54
  - lib/whenever.rb
54
55
  - README.rdoc
55
56
  files:
@@ -63,6 +64,7 @@ files:
63
64
  - lib/job_types/runner.rb
64
65
  - lib/outputs/cron.rb
65
66
  - lib/tasks/whenever.rake
67
+ - lib/version.rb
66
68
  - lib/whenever.rb
67
69
  - Manifest
68
70
  - Rakefile
@@ -104,7 +106,7 @@ rubyforge_project: whenever
104
106
  rubygems_version: 1.2.0
105
107
  signing_key:
106
108
  specification_version: 2
107
- summary: Provides (clean) ruby syntax for defining (messy) cron jobs and running them Whenever.
109
+ summary: Provides clean ruby syntax for defining messy cron jobs and running them Whenever.
108
110
  test_files:
109
111
  - test/cron_test.rb
110
112
  - test/output_command_test.rb