Sha256: 0ec15a4990f139081530b8aac7ff9b63af0f8578c4657195a6a21cddd3c835f9

Contents?: true

Size: 525 Bytes

Versions: 28

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

class Puppet::Confine::Any < Puppet::Confine
  def self.summarize(confines)
    confines.inject(0) { |count, confine| count + confine.summary }
  end

  def pass?(value)
    !!value
  end

  def message(value)
    "0 confines (of #{value.length}) were true"
  end

  def summary
    result.find_all { |v| v == true }.length
  end

  def valid?
    if @values.any? { |value| pass?(value) }
      true
    else
      Puppet.debug { "#{label}: #{message(@values)}" }
      false
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/confine/any.rb
puppet-8.10.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.10.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.10.0-universal-darwin lib/puppet/confine/any.rb
puppet-8.9.0 lib/puppet/confine/any.rb
puppet-8.9.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.9.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.9.0-universal-darwin lib/puppet/confine/any.rb
puppet-8.8.1 lib/puppet/confine/any.rb
puppet-8.8.1-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.8.1-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.8.1-universal-darwin lib/puppet/confine/any.rb
puppet-8.7.0 lib/puppet/confine/any.rb
puppet-8.7.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.7.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.7.0-universal-darwin lib/puppet/confine/any.rb
puppet-8.6.0 lib/puppet/confine/any.rb
puppet-8.6.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.6.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.6.0-universal-darwin lib/puppet/confine/any.rb