Skip to content

Commit

Permalink
Merge pull request #884 from nanoc/handle-sass-filesystem-importer-in…
Browse files Browse the repository at this point in the history
…-checksummer

Handle Sass::Importers::Filesystem in checksummer
  • Loading branch information
denisdefreyne committed Jul 1, 2016
2 parents 0fc7f01 + 2ca5d1c commit 262a8ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/nanoc/base/checksummer.rb
Expand Up @@ -194,6 +194,12 @@ def self.update(obj, _digest)

class RescueUpdateBehavior < UpdateBehavior
def self.update(obj, digest)
if obj.class.to_s == 'Sass::Importers::Filesystem'
digest.update('root=')
digest.update(obj.root)
return
end

data = begin
Marshal.dump(obj)
rescue
Expand Down
8 changes: 8 additions & 0 deletions spec/nanoc/base/checksummer_spec.rb
Expand Up @@ -276,6 +276,14 @@
it { is_expected.to eql('Nanoc::ItemCollectionWithoutRepsView<Nanoc::Int::IdentifiableCollection<Nanoc::Int::Item<content=Nanoc::Int::TextualContent<String<foo>>,attributes=Hash<>,identifier=Nanoc::Identifier<String</foo.md>>>,Nanoc::Int::Item<content=Nanoc::Int::TextualContent<String<bar>>,attributes=Hash<>,identifier=Nanoc::Identifier<String</foo.md>>>,>>') }
end

context 'Sass::Importers::Filesystem' do
let(:obj) { Sass::Importers::Filesystem.new('/foo') }

before { require 'sass' }

it { is_expected.to eql('Sass::Importers::Filesystem<root=/foo>') }
end

context 'other marshal-able classes' do
let(:obj) { klass.new('hello') }

Expand Down

0 comments on commit 262a8ad

Please sign in to comment.