Class: Puppet::Confine::Feature

Inherits:
Puppet::Confine show all
Defined in:
lib/puppet/confine/feature.rb

Constant Summary

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows, Util::DEFAULT_POSIX_MODE, Util::DEFAULT_WINDOWS_MODE, Util::RFC_3986_URI_REGEX

Constants included from Util::SymbolicFileMode

Util::SymbolicFileMode::SetGIDBit, Util::SymbolicFileMode::SetUIDBit, Util::SymbolicFileMode::StickyBit, Util::SymbolicFileMode::SymbolicMode, Util::SymbolicFileMode::SymbolicSpecialToBit

Constants included from Util::POSIX

Util::POSIX::LOCALE_ENV_VARS, Util::POSIX::USER_ENV_VARS

Instance Attribute Summary

Attributes inherited from Puppet::Confine

#for_binary, #label, #values

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Puppet::Confine

#for_binary?, inherited, #initialize, #reset, #result, test, #valid?

Methods included from Util

absolute_path?, benchmark, chuser, clear_environment, default_env, deterministic_rand, deterministic_rand_int, exit_on_fail, get_env, get_environment, logmethods, merge_environment, path_to_uri, pretty_backtrace, replace_file, safe_posix_fork, set_env, symbolizehash, thinmark, uri_encode, uri_query_encode, uri_to_path, which, withenv, withumask

Methods included from Util::SymbolicFileMode

#normalize_symbolic_mode, #symbolic_mode_to_int, #valid_symbolic_mode?

Methods included from Util::POSIX

#get_posix_field, #gid, groups_of, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Constructor Details

This class inherits a constructor from Puppet::Confine

Class Method Details

.summarize(confines) ⇒ Object


4
5
6
# File 'lib/puppet/confine/feature.rb', line 4

def self.summarize(confines)
  confines.collect { |c| c.values }.flatten.uniq.find_all { |value| ! confines[0].pass?(value) }
end

Instance Method Details

#message(value) ⇒ Object


13
14
15
# File 'lib/puppet/confine/feature.rb', line 13

def message(value)
  "feature #{value} is missing"
end

#pass?(value) ⇒ Boolean

Is the named feature available?


9
10
11
# File 'lib/puppet/confine/feature.rb', line 9

def pass?(value)
  Puppet.features.send(value.to_s + "?")
end