Skip to content

Commit

Permalink
Don't destructively modify options with force_update.
Browse files Browse the repository at this point in the history
Closes sassgh-175
Closes sassgh-176
  • Loading branch information
nex3 committed Nov 24, 2011
1 parent fc056d7 commit cc73198
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions doc-src/SASS_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Add new `updated_stylesheet` callback, which is run after each stylesheet has
been successfully compiled. Thanks to [Christian Peters](https://github.com/ChristianPeters).
* Allow absolute paths to be used in an importer with a different root.
* Don't destructively modify the options when running `Sass::Plugin.force_update`.

### Deprecations -- Must Read!

Expand Down
12 changes: 4 additions & 8 deletions lib/sass/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ def update_stylesheets(individual_files = [])
# the second is the location of the CSS file that it should be compiled to.
# @see #update_stylesheets
def force_update_stylesheets(individual_files = [])
old_options = options
self.options = options.dup
options[:never_update] = false
options[:always_update] = true
options[:cache] = false
update_stylesheets(individual_files)
ensure
self.options = old_options
Compiler.new(options.dup.merge(
:never_update => false,
:always_update => true,
:cache => false)).update_stylesheets(individual_files)
end

# All other method invocations are proxied to the \{#compiler}.
Expand Down

0 comments on commit cc73198

Please sign in to comment.