Sha256: ce6ff0f0c222a9c22ac9a3f6590638a566f0092456e69a3bfe47d028cac294ba

Contents?: true

Size: 793 Bytes

Versions: 6

Compression:

Stored size: 793 Bytes

Contents

module Nanoc::Int
  # @api private
  class OutdatednessRule
    include Nanoc::Int::ContractsSupport
    include Singleton

    def call(obj, outdatedness_checker)
      Nanoc::Int::NotificationCenter.post(:outdatedness_rule_started, self.class, obj)
      apply(obj, outdatedness_checker)
    ensure
      Nanoc::Int::NotificationCenter.post(:outdatedness_rule_ended, self.class, obj)
    end

    def apply(_obj, _outdatedness_checker)
      raise NotImplementedError.new('Nanoc::Int::OutdatednessRule subclasses must implement #apply')
    end

    contract C::None => String
    def inspect
      "#{self.class.name}(#{reason})"
    end

    def self.affects_props(*names)
      @affected_props = Set.new(names)
    end

    def self.affected_props
      @affected_props
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.8 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.7 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.6 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.5 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.4 lib/nanoc/base/services/outdatedness_rule.rb