Skip to content

Commit

Permalink
Let AttributesModified use precalculated checksums
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Apr 17, 2017
1 parent 0d99a74 commit bfdbcc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -17,7 +17,7 @@ class AttributesModified < Nanoc::Int::OutdatednessRule
return Nanoc::Int::OutdatednessReasons::AttributesModified.new(true)
end

new_checksums = Nanoc::Int::Checksummer.calc_for_each_attribute_of(obj)
new_checksums = outdatedness_checker.checksums.attributes_checksum_for(obj)

attributes = Set.new(old_checksums.keys) + Set.new(new_checksums.keys)
changed_attributes = attributes.reject { |a| old_checksums[a] == new_checksums[a] }
Expand Down
4 changes: 4 additions & 0 deletions spec/nanoc/base/services/outdatedness_checker_spec.rb
Expand Up @@ -164,6 +164,10 @@
let(:distant_item) { Nanoc::Int::Item.new('distant stuff', {}, '/distant.md') }
let(:distant_item_rep) { Nanoc::Int::ItemRep.new(distant_item, :default) }

let(:items) do
Nanoc::Int::IdentifiableCollection.new(config, [item, other_item, distant_item])
end

let(:action_sequences) do
{
item_rep => new_action_sequence_for_item_rep,
Expand Down

0 comments on commit bfdbcc9

Please sign in to comment.