def delay_application_controller_loading
if application_controller_source = ["#{Dir.pwd}/app/controllers/application.rb", "#{Dir.pwd}/app/controllers/application_controller.rb"].find { |f| File.exist?(f) }
application_helper_source = "#{Dir.pwd}/app/helpers/application_helper.rb"
load_paths = (::ActiveSupport.const_defined?(:Dependencies) ? ::ActiveSupport::Dependencies : ::Dependencies).load_paths
load_paths.unshift(File.expand_path('rails_stub_files', File.dirname(__FILE__)))
Spork.each_run do
require application_controller_source
require application_helper_source if File.exist?(application_helper_source)
ApplicationController.send(:helper, ApplicationHelper)
end
end
end