Module | Sass::Plugin |
In: |
lib/sass/plugin.rb
|
Non-destructively modifies \{options} so that default values are properly set.
@param additional_options [Hash<Symbol, Object>] An options hash with which to merge \{options} @return [Hash<Symbol, Object>] The modified options hash
# File lib/sass/plugin.rb, line 46 46: def engine_options(additional_options = {}) 47: opts = options.dup.merge(additional_options) 48: opts[:load_paths] = load_paths(opts) 49: opts 50: end
Updates out-of-date stylesheets.
Checks each Sass file in {file:SASS_REFERENCE.md#template_location-option `:template_location`} to see if it‘s been modified more recently than the corresponding CSS file in {file:SASS_REFERENCE.md#css_location-option} `:css_location`}. If it has, it updates the CSS file.
# File lib/sass/plugin.rb, line 58 58: def update_stylesheets 59: return if options[:never_update] 60: 61: @checked_for_updates = true 62: template_locations.zip(css_locations).each do |template_location, css_location| 63: 64: Dir.glob(File.join(template_location, "**", "*.sass")).each do |file| 65: # Get the relative path to the file with no extension 66: name = file.sub(template_location + "/", "")[0...-5] 67: 68: if !forbid_update?(name) && (options[:always_update] || stylesheet_needs_update?(name, template_location, css_location)) 69: update_stylesheet(name, template_location, css_location) 70: end 71: end 72: end 73: end