cowboyd/less.rb — pull request #75 by DEfusion (2014-06-30 15:16:07+00:00)
Title: Add ability to provide default JavaScript load paths

This allows us to add our own load paths and thus load external JavaScript files such as custom less functions. For example we could do the following, note for this to work the gem must not be required by the Gemfile due to auto initialisation of the loader.

```ruby
module Less
module Defaults
def self.extended(base)
base.javascript_paths << ::Rails.root.join('lib', 'assets', 'javascripts')
end
end

module Customisations
def self.included(base)
loader = base.instance_variable_get :@loader
loader.require('less/custom-less-functions')
end
end
end

require 'less'

module Less
include Less::Customisations
end