Skip to content

Instantly share code, notes, and snippets.

@christhekeele
Forked from thetron/config.rb
Last active August 31, 2015 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christhekeele/0ecfe1e14d037be49eaf to your computer and use it in GitHub Desktop.
Save christhekeele/0ecfe1e14d037be49eaf to your computer and use it in GitHub Desktop.
Middleman Rails Assets config
# config.rb
after_configuration do
if defined?(RailsAssets)
RailsAssets.load_paths.each do |path|
sprockets.append_path path unless sprockets.paths.include? path
Dir[File.join(path, '*')].select do |contents|
File.file? contents
end.map do |file|
Pathname.new File.basename file
end.each do |asset|
sprockets.import_asset asset unless sprockets.imported_assets.map(&:logical_path).include? asset
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment