From 95339dad23fe024be7455fcf6c7ff0a62d69623b Mon Sep 17 00:00:00 2001 From: kematzy Date: Mon, 16 Jul 2012 16:58:30 +0800 Subject: [PATCH] Added :js_assets_paths for external JS repositories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Please Note! This fix depends upon support in the 'middleman-sprockets' gem, where the following code must be present: # lib/middleman-sprockets/extension.rb append_path app.css_dir # add custom assets paths to the scope app.js_assets_paths.each do |p| append_path p end The purpose of this addition is to support including JS files from external (global) repositories. Example usage: # in config.rb set :js_assets_path, [ "#{root}/assets/js/", "~/.js-repo/"] Using symlinks or copying files to the Middleman project can get messy quickly. This fix reduces some of those issues. --- middleman-core/lib/middleman-core/application.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/middleman-core/lib/middleman-core/application.rb b/middleman-core/lib/middleman-core/application.rb index 68ad2623..a4259d77 100644 --- a/middleman-core/lib/middleman-core/application.rb +++ b/middleman-core/lib/middleman-core/application.rb @@ -109,6 +109,11 @@ module Middleman # @return [String] set :css_dir, "stylesheets" + # Location of javascripts external to source directory. + # @return [Array] + # set :js_assets_paths, ["#{root}/assets/javascripts/", "/path/2/external/js/repository/"] + set :js_assets_paths, [] + # Location of SASS/SCSS files external to source directory. # @return [Array] # set :sass_assets_paths, ["#{root}/assets/sass/", "/path/2/external/sass/repository/"]