diff options
author | Lucas Mazza <lucastmazza@gmail.com> | 2015-09-09 05:37:34 +0300 |
---|---|---|
committer | Lucas Mazza <lucastmazza@gmail.com> | 2015-09-11 22:43:55 +0300 |
commit | 3e0fafa09a362e601372d078926398c59ba91d67 (patch) | |
tree | 3dfc7a5358eee10b05cf213b0238d802f00f725e | |
parent | f1d9a2411839cfadeb2717b578734bbab8fb458b (diff) |
Add support for `sprockets-rails` 3 and `sprockets` 4.
`sprockets-rails` 3 already precompiles any asset that is referenced by the `font-path`
and `image-path` helpers, and `sprockets` 4 does not support Regexpes as the
`precompile` flag.
-rw-r--r-- | lib/bootstrap-sass/engine.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bootstrap-sass/engine.rb b/lib/bootstrap-sass/engine.rb index fe5c4a6e..d288080e 100644 --- a/lib/bootstrap-sass/engine.rb +++ b/lib/bootstrap-sass/engine.rb @@ -5,7 +5,12 @@ module Bootstrap %w(stylesheets javascripts fonts images).each do |sub| app.config.assets.paths << root.join('assets', sub).to_s end - app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$) + + # sprockets-rails 3 tracks down the calls to `font_path` and `image_path` + # and automatically precompiles the referenced assets. + unless Sprockets::Rails::VERSION.starts_with?('3') + app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$) + end end end end |