Class: Nanoc::Int::OutdatednessChecker Private
- Inherits:
-
Object
- Object
- Nanoc::Int::OutdatednessChecker
- Extended by:
- Memoization
- Defined in:
- lib/nanoc/base/compilation/outdatedness_checker.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Responsible for determining whether an item or a layout is outdated.
Constant Summary collapse
- Reasons =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Nanoc::Int::OutdatednessReasons
Constants included from Memoization
Instance Attribute Summary collapse
- #checksum_store ⇒ Object readonly private
- #dependency_store ⇒ Object readonly private
- #rule_memory_store ⇒ Object readonly private
- #site ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(site:, checksum_store:, dependency_store:, rule_memory_store:, action_provider:, reps:) ⇒ OutdatednessChecker
constructor
private
A new instance of OutdatednessChecker.
-
#outdated?(obj) ⇒ Boolean
private
Checks whether the given object is outdated and therefore needs to be recompiled.
-
#outdatedness_reason_for(obj) ⇒ Reasons::Generic?
private
Calculates the reason why the given object is outdated.
Methods included from Memoization
Constructor Details
#initialize(site:, checksum_store:, dependency_store:, rule_memory_store:, action_provider:, reps:) ⇒ OutdatednessChecker
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of OutdatednessChecker.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 21 def initialize(site:, checksum_store:, dependency_store:, rule_memory_store:, action_provider:, reps:) @site = site @checksum_store = checksum_store @dependency_store = dependency_store @rule_memory_store = rule_memory_store @action_provider = action_provider @reps = reps @basic_outdatedness_reasons = {} @outdatedness_reasons = {} @objects_outdated_due_to_dependencies = {} end |
Instance Attribute Details
#checksum_store ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 8 def checksum_store @checksum_store end |
#dependency_store ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 9 def dependency_store @dependency_store end |
#rule_memory_store ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 10 def rule_memory_store @rule_memory_store end |
#site ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 11 def site @site end |
Instance Method Details
#outdated?(obj) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks whether the given object is outdated and therefore needs to be recompiled.
41 42 43 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 41 def outdated?(obj) !outdatedness_reason_for(obj).nil? end |
#outdatedness_reason_for(obj) ⇒ Reasons::Generic?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Calculates the reason why the given object is outdated.
52 53 54 55 56 57 58 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 52 def outdatedness_reason_for(obj) reason = basic_outdatedness_reason_for(obj) if reason.nil? && outdated_due_to_dependencies?(obj) reason = Reasons::DependenciesOutdated end reason end |