Sha256: 439f656954acc399cc914fcbeeb93ed7fc09aaf3d831a5e4f03cde3cacd7f286

Contents?: true

Size: 512 Bytes

Versions: 20

Compression:

Stored size: 512 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).inject([]) { |array, args| val, f = args; array << f unless val; array }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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