Class: Nanoc::OutdatednessChecker Private
- Inherits:
-
Object
- Object
- Nanoc::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.
Instance Method Summary (collapse)
-
- (OutdatednessChecker) initialize(params = {})
constructor
private
A new instance of OutdatednessChecker.
-
- (Boolean) outdated?(obj)
private
Checks whether the given object is outdated and therefore needs to be recompiled.
-
- (Nanoc::OutdatednessReasons::Generic?) outdatedness_reason_for(obj)
private
Calculates the reason why the given object is outdated.
Methods included from Memoization
Constructor Details
- (OutdatednessChecker) initialize(params = {})
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
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/nanoc/base/compilation/outdatedness_checker.rb', line 18 def initialize(params = {}) @site = params.fetch(:site) do raise ArgumentError, 'Nanoc::OutdatednessChecker#initialize needs a :site parameter' end @checksum_store = params.fetch(:checksum_store) do raise ArgumentError, 'Nanoc::OutdatednessChecker#initialize needs a :checksum_store parameter' end @dependency_tracker = params.fetch(:dependency_tracker) do raise ArgumentError, 'Nanoc::OutdatednessChecker#initialize needs a :dependency_tracker parameter' end @basic_outdatedness_reasons = {} @outdatedness_reasons = {} @objects_outdated_due_to_dependencies = {} end |
Instance Method Details
- (Boolean) outdated?(obj)
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 |
- (Nanoc::OutdatednessReasons::Generic?) outdatedness_reason_for(obj)
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 = Nanoc::OutdatednessReasons::DependenciesOutdated end reason end |