Skip to content

Instantly share code, notes, and snippets.

@mcmire
Created August 17, 2010 16:13
Show Gist options
  • Save mcmire/530601 to your computer and use it in GitHub Desktop.
Save mcmire/530601 to your computer and use it in GitHub Desktop.
Patch to speed up Spork
# Don't reload views or routes
# This (along with setting cache_classes to false) brought running a
# single spec file down from 7.4s to 2.8s
# See discussion: http://github.com/timcharper/spork/issues#issue/13
#
# To install, put this in spec/support and then require it in your spec_helper like:
#
# require 'spork'
# require File.expand_path(File.dirname(__FILE__) + "/support/spork")
#
begin
require 'spork/app_framework/rails'
module Spork::AppFramework::Rails::NinjaPatcher
# Don't reload views.
# The tradeoff here is that you'll have to restart Spork when you modify a view.
def delay_eager_view_loading
end
# Don't reload routes.
# The tradeoff here is that you'll have to restart Spork when you modify routes.
def delay_route_loading
end
end
rescue
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment