Class: Puppet::Confine::PostfixVersion
- Inherits:
-
Puppet::Confine
- Object
- Puppet::Confine
- Puppet::Confine::PostfixVersion
- Defined in:
- lib/puppet/confine/postfix_version.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.postfix_version ⇒ Object
19 20 21 22 23 |
# File 'lib/puppet/confine/postfix_version.rb', line 19 def self.postfix_version postfix_facts = ::Facter.value(:postfix) return :absent if postfix_facts.nil? postfix_facts[:version] end |
.summarize(confines) ⇒ Object
5 6 7 |
# File 'lib/puppet/confine/postfix_version.rb', line 5 def self.summarize(confines) confines.map(&:values).flatten.uniq.reject { |value| confines[0].pass?(value) } end |
Instance Method Details
#message(value) ⇒ Object
15 16 17 |
# File 'lib/puppet/confine/postfix_version.rb', line 15 def (value) "postfix version >= #{value} required (have #{self.class.postfix_version})" end |
#pass?(value) ⇒ Boolean
9 10 11 12 13 |
# File 'lib/puppet/confine/postfix_version.rb', line 9 def pass?(value) postfix_version = self.class.postfix_version return false if postfix_version == :absent Puppet::Util::Package.versioncmp(postfix_version, value) >= 0 end |