Sha256: 0f3e6f29ae8f970e35c062325b1dc6ff54c0d1e6483521780037b3e3c4883dfb

Contents?: true

Size: 492 Bytes

Versions: 539

Compression:

Stored size: 492 Bytes

Contents

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

539 entries across 539 versions & 3 rubygems

Version Path
puppet-5.5.22 lib/puppet/confine/any.rb
puppet-5.5.22-x86-mingw32 lib/puppet/confine/any.rb
puppet-5.5.22-x64-mingw32 lib/puppet/confine/any.rb
puppet-5.5.22-universal-darwin lib/puppet/confine/any.rb
puppet-6.17.0 lib/puppet/confine/any.rb
puppet-6.17.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-6.17.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-6.17.0-universal-darwin lib/puppet/confine/any.rb
puppet-5.5.21 lib/puppet/confine/any.rb
puppet-5.5.21-x86-mingw32 lib/puppet/confine/any.rb
puppet-5.5.21-x64-mingw32 lib/puppet/confine/any.rb
puppet-5.5.21-universal-darwin lib/puppet/confine/any.rb
puppet-6.16.0 lib/puppet/confine/any.rb
puppet-6.16.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-6.16.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-6.16.0-universal-darwin lib/puppet/confine/any.rb
puppet-6.15.0 lib/puppet/confine/any.rb
puppet-6.15.0-x86-mingw32 lib/puppet/confine/any.rb
puppet-6.15.0-x64-mingw32 lib/puppet/confine/any.rb
puppet-6.15.0-universal-darwin lib/puppet/confine/any.rb