From 703fecb4fc81c3a975a53c9c4534f40193bd1ab9 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 24 Nov 2008 11:37:57 -0600 Subject: [PATCH] Add LAZY env flag for testing autoload/lazy load feature --- actionmailer/lib/action_mailer.rb | 3 +-- actionpack/lib/action_controller.rb | 2 +- actionpack/lib/action_view.rb | 2 +- activerecord/lib/active_record.rb | 2 +- activesupport/lib/active_support.rb | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb index d442004011..dbb3fae13a 100644 --- a/actionmailer/lib/action_mailer.rb +++ b/actionmailer/lib/action_mailer.rb @@ -58,5 +58,4 @@ end autoload :MailHelper, 'action_mailer/mail_helper' autoload :TMail, 'action_mailer/vendor/tmail' -# TODO: Don't explicitly load entire lib -ActionMailer.load_all! +ActionMailer.load_all! unless ENV['LAZY'] diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index 8b4819bf65..08e6f4efa8 100644 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -101,4 +101,4 @@ autoload :Mime, 'action_controller/mime_type' autoload :HTML, 'action_controller/vendor/html-scanner' autoload :Rack, 'action_controller/vendor/rack' -ActionController.load_all! +ActionController.load_all! unless ENV['LAZY'] diff --git a/actionpack/lib/action_view.rb b/actionpack/lib/action_view.rb index 0c76204060..436bce4a69 100644 --- a/actionpack/lib/action_view.rb +++ b/actionpack/lib/action_view.rb @@ -56,4 +56,4 @@ end I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml" -ActionView.load_all! +ActionView.load_all! unless ENV['LAZY'] diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index 584349659e..612e2313ae 100644 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -72,4 +72,4 @@ end require 'active_record/i18n_interpolation_deprecation' I18n.load_path << File.dirname(__FILE__) + '/active_record/locale/en.yml' -ActiveRecord.load_all! +ActiveRecord.load_all! unless ENV['LAZY'] diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb index 6e1cda427b..b9b41ffa8b 100644 --- a/activesupport/lib/active_support.rb +++ b/activesupport/lib/active_support.rb @@ -56,4 +56,4 @@ require 'active_support/core_ext' I18n.load_path << "#{File.dirname(__FILE__)}/active_support/locale/en.yml" -ActiveSupport.load_all! +ActiveSupport.load_all! unless ENV['LAZY']