lib/nanoc/base/services/outdatedness_checker.rb in nanoc-4.11.8 vs lib/nanoc/base/services/outdatedness_checker.rb in nanoc-4.11.9

- old
+ new

@@ -46,17 +46,17 @@ Rules::LayoutCollectionExtended, ].freeze C_OBJ_MAYBE_REP = C::Or[Nanoc::Core::Item, Nanoc::Core::ItemRep, Nanoc::Core::Configuration, Nanoc::Core::Layout, Nanoc::Core::ItemCollection, Nanoc::Core::LayoutCollection] - contract C::KeywordArgs[outdatedness_checker: OutdatednessChecker, reps: Nanoc::Int::ItemRepRepo] => C::Any + contract C::KeywordArgs[outdatedness_checker: OutdatednessChecker, reps: Nanoc::Core::ItemRepRepo] => C::Any def initialize(outdatedness_checker:, reps:) @outdatedness_checker = outdatedness_checker @reps = reps end - contract C_OBJ_MAYBE_REP => C::Maybe[OutdatednessStatus] + contract C_OBJ_MAYBE_REP => C::Maybe[Nanoc::Core::OutdatednessStatus] memoized def outdatedness_status_for(obj) case obj when Nanoc::Core::ItemRep apply_rules(RULES_FOR_ITEM_REP, obj) when Nanoc::Core::Item @@ -74,12 +74,12 @@ end end private - contract C::ArrayOf[Class], C_OBJ_MAYBE_REP, OutdatednessStatus => C::Maybe[OutdatednessStatus] - def apply_rules(rules, obj, status = OutdatednessStatus.new) + contract C::ArrayOf[Class], C_OBJ_MAYBE_REP, Nanoc::Core::OutdatednessStatus => C::Maybe[Nanoc::Core::OutdatednessStatus] + def apply_rules(rules, obj, status = Nanoc::Core::OutdatednessStatus.new) rules.inject(status) do |acc, rule| if !acc.useful_to_apply?(rule) acc else reason = rule.instance.call(obj, @outdatedness_checker) @@ -90,13 +90,13 @@ end end end end - contract C::ArrayOf[Class], C::ArrayOf[C_OBJ_MAYBE_REP] => C::Maybe[OutdatednessStatus] + contract C::ArrayOf[Class], C::ArrayOf[C_OBJ_MAYBE_REP] => C::Maybe[Nanoc::Core::OutdatednessStatus] def apply_rules_multi(rules, objs) - objs.inject(OutdatednessStatus.new) { |acc, elem| apply_rules(rules, elem, acc) } + objs.inject(Nanoc::Core::OutdatednessStatus.new) { |acc, elem| apply_rules(rules, elem, acc) } end end DDMemoize.activate(self) @@ -107,17 +107,17 @@ attr_reader :dependency_store attr_reader :action_sequence_store attr_reader :action_sequences attr_reader :site - Reasons = Nanoc::Int::OutdatednessReasons + Reasons = Nanoc::Core::OutdatednessReasons C_OBJ = C::Or[Nanoc::Core::Item, Nanoc::Core::ItemRep, Nanoc::Core::Configuration, Nanoc::Core::Layout, Nanoc::Core::ItemCollection] C_ITEM_OR_REP = C::Or[Nanoc::Core::Item, Nanoc::Core::ItemRep] C_ACTION_SEQUENCES = C::HashOf[C_OBJ => Nanoc::Core::ActionSequence] - contract C::KeywordArgs[site: Nanoc::Core::Site, checksum_store: Nanoc::Int::ChecksumStore, checksums: Nanoc::Core::ChecksumCollection, dependency_store: Nanoc::Int::DependencyStore, action_sequence_store: Nanoc::Int::ActionSequenceStore, action_sequences: C_ACTION_SEQUENCES, reps: Nanoc::Int::ItemRepRepo] => C::Any + contract C::KeywordArgs[site: Nanoc::Core::Site, checksum_store: Nanoc::Core::ChecksumStore, checksums: Nanoc::Core::ChecksumCollection, dependency_store: Nanoc::Core::DependencyStore, action_sequence_store: Nanoc::Core::ActionSequenceStore, action_sequences: C_ACTION_SEQUENCES, reps: Nanoc::Core::ItemRepRepo] => C::Any def initialize(site:, checksum_store:, checksums:, dependency_store:, action_sequence_store:, action_sequences:, reps:) @site = site @checksum_store = checksum_store @checksums = checksums @dependency_store = dependency_store @@ -200,15 +200,15 @@ active.any? end def attributes_unaffected?(status, dependency) - reason = status.reasons.find { |r| r.is_a?(Nanoc::Int::OutdatednessReasons::AttributesModified) } + reason = status.reasons.find { |r| r.is_a?(Nanoc::Core::OutdatednessReasons::AttributesModified) } reason && dependency.props.attributes.is_a?(Enumerable) && (dependency.props.attributes & reason.attributes).empty? end def raw_content_unaffected?(status, dependency) - reason = status.reasons.find { |r| r.is_a?(Nanoc::Int::OutdatednessReasons::DocumentCollectionExtended) } + reason = status.reasons.find { |r| r.is_a?(Nanoc::Core::OutdatednessReasons::DocumentCollectionExtended) } if reason.nil? false elsif !dependency.props.raw_content.is_a?(Enumerable) false else