Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tommay/tilt-preload
Ruby gem to avoid tilt 2.x's non thread-safe autoload warnings.
https://github.com/tommay/tilt-preload
Last synced: about 6 hours ago
JSON representation
Ruby gem to avoid tilt 2.x's non thread-safe autoload warnings.
- Host: GitHub
- URL: https://github.com/tommay/tilt-preload
- Owner: tommay
- License: mit
- Created: 2015-03-21T00:27:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-21T01:26:42.000Z (over 9 years ago)
- Last Synced: 2024-11-13T20:12:49.406Z (4 days ago)
- Language: Ruby
- Size: 137 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
tilt-preload
============[![Gem Version](https://badge.fury.io/rb/tilt-preload.svg)](http://badge.fury.io/rb/tilt-preload)
[![Build Status](https://travis-ci.org/tommay/tilt-preload.svg)](https://travis-ci.org/tommay/tilt-preload)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](https://github.com/kenichi/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](https://github.com/rtomayko/tilt/pull/253)
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.