-
Notifications
You must be signed in to change notification settings - Fork 8
Support bootstrap-sass and font-awesome-sass gems (ie. *= require bootstrap in directive) #17
Comments
Thanks for the kind words! I will take a look at this in the next few days. I believe the load paths need to be sync'd up here |
+1 For bootstrap-sass support. When using
Is there an easy fix for adding bootstrap-sass path to pipeline? |
Hey guys I did some work on this today. The gem should now support basic external sprocket configurations. But alot of these external gems are doing things differently from each other 😦. But I did add an example here on how to use paths from here. It does require some digging into code, but not too much. Let me know if this is acceptable. |
That works, thanks a lot! |
Here's my ugliness for dealing with this so I can use configure_assets do |assets|
assets.pipeline = Padrino::Pipeline::Sprockets
assets.js_assets = [assets.js_assets] unless assets.js_assets.is_a?(Array)
assets.css_assets = [assets.css_assets] unless assets.css_assets.is_a?(Array)
assets.image_assets = [assets.image_assets] unless assets.image_assets.is_a?(Array)
# Load assets from gems
$:.each do |path|
assets_base = File.join(path, '..', 'vendor', 'assets')
%w{javascripts stylesheets images}.each do |type|
dir = File.join(assets_base, type)
if File.directory?(dir)
case type
when 'javascripts'
assets.js_assets << dir
when 'stylesheets'
assets.css_assets << dir
when 'images'
assets.image_assets << dir
end
end
end
end
end But with bootstrap-sass, now my app is exploding because of #22 |
@pdf, Would it possible to do a PR with your fix? Also, do you have the output of your bootstrap-sass app that explodes? Thanks! |
@Ortuna, I don't know that this is an optimal fix generally, but it will work with any gem that puts assets in Here's the output from the sass font failure (actually from
I can probably hack around that by: assets.context_class.class_eval do
def asset_path(path, options = {})
"/assets/#{path}"
end
end or something, but I haven't had time to test this properly. |
This can probably be more generalized to apply to anything that would end up in the vendor path, but after working with this for an evening, I'm a little stumped how to get padrino-pipeline (which I'm loving btw, very nice work) to use these two gems, both of which would be extremely nice to use along with the pipelining in padrino -- minimally with sprockets at the very least.
Am I just being dense here or is there a way to get p-p to ingest and use these two things?
(furthermore, I'm assuming there is also no way to pipeline font directory assets either? Looking in the code the asset paths supported seem to be only images, javascripts and stylesheets.).
The text was updated successfully, but these errors were encountered: