Sha256: b8207cba2401f9e8880f4700f4e00f56d27a39459b44350e1c4461e764d2b48e

Contents?: true

Size: 525 Bytes

Versions: 20

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

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/confine/any.rb
puppet-8.3.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.3.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.3.0-universal-darwin lib/puppet/confine/any.rb
puppet-8.3.1 lib/puppet/confine/any.rb
puppet-8.3.1-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.3.1-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.3.1-universal-darwin lib/puppet/confine/any.rb
puppet-8.2.0 lib/puppet/confine/any.rb
puppet-8.2.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.2.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.2.0-universal-darwin lib/puppet/confine/any.rb
puppet-8.1.0 lib/puppet/confine/any.rb
puppet-8.1.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.1.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.1.0-universal-darwin lib/puppet/confine/any.rb
puppet-8.0.1 lib/puppet/confine/any.rb
puppet-8.0.1-x86-mingw32 lib/puppet/confine/any.rb
puppet-8.0.1-x64-mingw32 lib/puppet/confine/any.rb
puppet-8.0.1-universal-darwin lib/puppet/confine/any.rb