Sha256: 10de9f4cb445e630ffa548d53dc39025d03c5f925b95ee475a1b7470e36f27fc

Contents?: true

Size: 517 Bytes

Versions: 28

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

require_relative '../../puppet/confine'

class Puppet::Confine::Exists < Puppet::Confine
  def self.summarize(confines)
    confines.inject([]) { |total, confine| total + confine.summary }
  end

  def pass?(value)
    value && (for_binary? ? which(value) : Puppet::FileSystem.exist?(value))
  end

  def message(value)
    "file #{value} does not exist"
  end

  def summary
    result.zip(values).each_with_object([]) { |args, array| val, f = args; array << f unless val; }
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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