From b84c8a8f0b62b0b16077b8d585ad1195ed1ff781 Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Tue, 20 Oct 2009 13:42:09 -0400 Subject: [PATCH] moved everthing into a whenever/ dir --- lib/whenever.rb | 40 ++++++++----------- lib/{ => whenever}/base.rb | 0 lib/{ => whenever}/command_line.rb | 0 lib/{ => whenever}/job_list.rb | 0 lib/{ => whenever}/job_types/default.rb | 0 lib/{ => whenever}/job_types/rake_task.rb | 0 lib/{ => whenever}/job_types/runner.rb | 0 lib/{ => whenever}/outputs/cron.rb | 0 .../outputs/cron/output_redirection.rb | 0 lib/{ => whenever}/version.rb | 0 10 files changed, 17 insertions(+), 23 deletions(-) rename lib/{ => whenever}/base.rb (100%) rename lib/{ => whenever}/command_line.rb (100%) rename lib/{ => whenever}/job_list.rb (100%) rename lib/{ => whenever}/job_types/default.rb (100%) rename lib/{ => whenever}/job_types/rake_task.rb (100%) rename lib/{ => whenever}/job_types/runner.rb (100%) rename lib/{ => whenever}/outputs/cron.rb (100%) rename lib/{ => whenever}/outputs/cron/output_redirection.rb (100%) rename lib/{ => whenever}/version.rb (100%) diff --git a/lib/whenever.rb b/lib/whenever.rb index 748fabc..96d7fb5 100644 --- a/lib/whenever.rb +++ b/lib/whenever.rb @@ -1,37 +1,31 @@ -unless defined?(Whenever) - $:.unshift(File.dirname(__FILE__)) - - # Hoping to load Rails' Rakefile - begin - load 'Rakefile' - rescue LoadError => e - nil - end -end - require 'chronic' +# Hoping to load Rails' Rakefile +begin + load 'Rakefile' +rescue LoadError + nil +end + # If Rails' rakefile was loaded than so was activesupport, but # if this is being used in a non-rails enviroment we need to require it. # It was previously defined as a dependency of this gem, but that became # problematic. See: http://github.com/javan/whenever/issues#issue/1 begin require 'activesupport' -rescue LoadError => e +rescue LoadError warn 'To user Whenever you need the activesupport gem:' warn '$ sudo gem install activesupport' exit(1) end # Whenever files -%w{ -base -version -job_list -job_types/default -job_types/rake_task -job_types/runner -outputs/cron -outputs/cron/output_redirection -command_line -}.each { |file| require File.expand_path(File.dirname(__FILE__) + "/#{file}") } \ No newline at end of file +require 'whenever/base' +require 'whenever/version' +require 'whenever/job_list' +require 'whenever/job_types/default' +require 'whenever/job_types/rake_task' +require 'whenever/job_types/runner' +require 'whenever/outputs/cron' +require 'whenever/outputs/cron/output_redirection' +require 'whenever/command_line' diff --git a/lib/base.rb b/lib/whenever/base.rb similarity index 100% rename from lib/base.rb rename to lib/whenever/base.rb diff --git a/lib/command_line.rb b/lib/whenever/command_line.rb similarity index 100% rename from lib/command_line.rb rename to lib/whenever/command_line.rb diff --git a/lib/job_list.rb b/lib/whenever/job_list.rb similarity index 100% rename from lib/job_list.rb rename to lib/whenever/job_list.rb diff --git a/lib/job_types/default.rb b/lib/whenever/job_types/default.rb similarity index 100% rename from lib/job_types/default.rb rename to lib/whenever/job_types/default.rb diff --git a/lib/job_types/rake_task.rb b/lib/whenever/job_types/rake_task.rb similarity index 100% rename from lib/job_types/rake_task.rb rename to lib/whenever/job_types/rake_task.rb diff --git a/lib/job_types/runner.rb b/lib/whenever/job_types/runner.rb similarity index 100% rename from lib/job_types/runner.rb rename to lib/whenever/job_types/runner.rb diff --git a/lib/outputs/cron.rb b/lib/whenever/outputs/cron.rb similarity index 100% rename from lib/outputs/cron.rb rename to lib/whenever/outputs/cron.rb diff --git a/lib/outputs/cron/output_redirection.rb b/lib/whenever/outputs/cron/output_redirection.rb similarity index 100% rename from lib/outputs/cron/output_redirection.rb rename to lib/whenever/outputs/cron/output_redirection.rb diff --git a/lib/version.rb b/lib/whenever/version.rb similarity index 100% rename from lib/version.rb rename to lib/whenever/version.rb