Sha256: ba9e495861b63ca92eb65ac6b6bb2ad830a42213a65f317ce96857e08b580fa9

Contents?: true

Size: 473 Bytes

Versions: 6

Compression:

Stored size: 473 Bytes

Contents

require '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::File.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

6 entries across 6 versions & 1 rubygems

Version Path
puppet-3.4.3 lib/puppet/confine/exists.rb
puppet-3.4.2 lib/puppet/confine/exists.rb
puppet-3.4.1 lib/puppet/confine/exists.rb
puppet-3.4.0 lib/puppet/confine/exists.rb
puppet-3.4.0.rc2 lib/puppet/confine/exists.rb
puppet-3.4.0.rc1 lib/puppet/confine/exists.rb