From 15d91a3efd1e423453715a8a89bfea82b22e659d Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Sun, 31 Jul 2011 09:27:18 -0400 Subject: [PATCH] prefer autoload to require --- lib/whenever.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/whenever.rb b/lib/whenever.rb index 8fa0a98..592ca80 100644 --- a/lib/whenever.rb +++ b/lib/whenever.rb @@ -2,14 +2,15 @@ require 'chronic' require 'active_support/all' require 'thread' -require 'whenever/job_list' -require 'whenever/job' -require 'whenever/cron' -require 'whenever/output_redirection' -require 'whenever/command_line' -require 'whenever/version' - module Whenever + autoload :JobList, 'whenever/job_list' + autoload :Job, 'whenever/job' + autoload :CommandLine, 'whenever/command_line' + + module Output + autoload :Cron, 'whenever/cron' + autoload :Redirection, 'whenever/output_redirection' + end def self.cron(options) Whenever::JobList.new(options).generate_cron_output @@ -26,5 +27,4 @@ module Whenever def self.bundler? File.exists?(File.join(path, 'Gemfile')) end - end