lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb in nanoc-4.11.8 vs lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb in nanoc-4.11.9
- old
+ new
@@ -1,16 +1,16 @@
# frozen_string_literal: true
module Nanoc
module Int
module OutdatednessRules
- class AttributesModified < Nanoc::Int::OutdatednessRule
+ class AttributesModified < Nanoc::Core::OutdatednessRule
include Nanoc::Core::ContractsSupport
affects_props :attributes, :compiled_content
- contract C::Or[Nanoc::Core::ItemRep, Nanoc::Core::Item, Nanoc::Core::Configuration, Nanoc::Core::Layout], C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::Int::OutdatednessReasons::Generic]
+ contract C::Or[Nanoc::Core::ItemRep, Nanoc::Core::Item, Nanoc::Core::Configuration, Nanoc::Core::Layout], C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::Core::OutdatednessReasons::Generic]
def apply(obj, outdatedness_checker)
case obj
when Nanoc::Core::ItemRep
apply(obj.item, outdatedness_checker)
when Nanoc::Core::Item, Nanoc::Core::Layout, Nanoc::Core::Configuration
@@ -18,19 +18,19 @@
return nil
end
old_checksums = outdatedness_checker.checksum_store.attributes_checksum_for(obj)
unless old_checksums
- return Nanoc::Int::OutdatednessReasons::AttributesModified.new(true)
+ return Nanoc::Core::OutdatednessReasons::AttributesModified.new(true)
end
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] }
if changed_attributes.any?
- Nanoc::Int::OutdatednessReasons::AttributesModified.new(changed_attributes)
+ Nanoc::Core::OutdatednessReasons::AttributesModified.new(changed_attributes)
end
else
raise ArgumentError
end
end