From 2e4ac83912a8d281b1fc7f4d2ba52d148977c8cd Mon Sep 17 00:00:00 2001 From: Denis Defreyne Date: Mon, 17 Apr 2017 11:17:53 +0200 Subject: [PATCH] Let AttributesModified use precalculated checksums --- .../base/services/outdatedness_rules/attributes_modified.rb | 2 +- spec/nanoc/base/services/outdatedness_checker_spec.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb b/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb index 0a02cfa3f0..e8746a88c6 100644 --- a/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +++ b/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb @@ -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] } diff --git a/spec/nanoc/base/services/outdatedness_checker_spec.rb b/spec/nanoc/base/services/outdatedness_checker_spec.rb index bfaaaa1149..29b26ff963 100644 --- a/spec/nanoc/base/services/outdatedness_checker_spec.rb +++ b/spec/nanoc/base/services/outdatedness_checker_spec.rb @@ -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,