Sha256: 20126f5a778686b88c93a5fd8434e80639dcb5563dd989df9f9d9d0713896d63

Contents?: true

Size: 471 Bytes

Versions: 18

Compression:

Stored size: 471 Bytes

Contents

module Nanoc::Int
  # @api private
  class OutdatednessStatus
    attr_reader :reasons
    attr_reader :props

    def initialize(reasons: [], props: Props.new)
      @reasons = reasons
      @props = props
    end

    def useful_to_apply?(rule)
      (rule.instance.reason.props.active - @props.active).any?
    end

    def update(reason)
      self.class.new(
        reasons: @reasons + [reason],
        props: @props.merge(reason.props),
      )
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
nanoc-4.7.3 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.7.2 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.7.1 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.7.0 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.6.4 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.6.3 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.6.2 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.6.1 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.6.0 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.5.4 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.5.3 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.5.2 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.5.1 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.5.0 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.4.7 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.4.6 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.4.5 lib/nanoc/base/entities/outdatedness_status.rb
nanoc-4.4.4 lib/nanoc/base/entities/outdatedness_status.rb