Sha256: 1db9e67ad9cbb21d1671f1119edb029dc44f05bdf0ef736aa9d6b3308527d334

Contents?: true

Size: 824 Bytes

Versions: 23

Compression:

Stored size: 824 Bytes

Contents

# frozen_string_literal: true

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

23 entries across 23 versions & 1 rubygems

Version Path
nanoc-4.8.17 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.16 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.15 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.14 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.13 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.12 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.11 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.10 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.9 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.8 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.7 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.6 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.5 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.4 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.3 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.2 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.1 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.8.0 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.14 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.7.13 lib/nanoc/base/services/outdatedness_rule.rb