0.0
No commit activity in last 3 years
No release in over 3 years
Load tilt/* files according to what classes have been defined.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.0
 Project Readme

tilt-preload

Gem Version Build Status

A simple gem to avoid the "non thread-safe autoload" warnings generated by tilt 2.x when it autoloads its tilt/* helper files.

Tilt is correct that autoloading these files isn't thread safe. This gem works by loading the necessary files at require time. Put "tilt-preload" in your Gemfile and require "tilt-preload" in your code instead of require "tilt". Require any template engines before require "tilt-preload":

require "haml"
require "redcarpet"
require "tilt-preload"

tilt-preload is most sugary when you're not using "tilt" directly, but using some other gem like angelo where angelo can use tilt under the hood and you don't care, just be sure to require your templating engines first:

require "haml"
require "redcarpet"
require "angelo"

There's a pull request open for tilt to include this functionality but I can't wait forever for it to be accepted or rejected so I made this silly gem in the interim.