Class: Nanoc3::OutdatednessChecker Private
- Inherits:
-
Object
- Object
- Nanoc3::OutdatednessChecker
- Extended by:
- Memoization
- Defined in:
- lib/nanoc3/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
-
#initialize(params = {}) ⇒ 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) ⇒ Nanoc3::OutdatednessReasons::Generic?
private
Calculates the reason why the given object is outdated.
Methods included from Memoization
Constructor Details
#initialize(params = {}) ⇒ 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.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/nanoc3/base/compilation/outdatedness_checker.rb', line 20 def initialize(params={}) @site = params[:site] or raise ArgumentError, 'Nanoc3::OutdatednessChecker#initialize needs a :site parameter' @checksum_store = params[:checksum_store] or raise ArgumentError, 'Nanoc3::OutdatednessChecker#initialize needs a :checksum_store parameter' @dependency_tracker = params[:dependency_tracker] or raise ArgumentError, 'Nanoc3::OutdatednessChecker#initialize needs a :dependency_tracker parameter' @basic_outdatedness_reasons = {} @outdatedness_reasons = {} @objects_outdated_due_to_dependencies = {} 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.
40 41 42 |
# File 'lib/nanoc3/base/compilation/outdatedness_checker.rb', line 40 def outdated?(obj) !outdatedness_reason_for(obj).nil? end |
#outdatedness_reason_for(obj) ⇒ Nanoc3::OutdatednessReasons::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.
51 52 53 54 55 56 57 |
# File 'lib/nanoc3/base/compilation/outdatedness_checker.rb', line 51 def outdatedness_reason_for(obj) reason = basic_outdatedness_reason_for(obj) if reason.nil? && outdated_due_to_dependencies?(obj) reason = Nanoc3::OutdatednessReasons::DependenciesOutdated end reason end |