Module: Puppet::Util::ClassGen
- Includes:
- Puppet::Util
- Included in:
- MetaType::Manager, Reports, Type, FileType, Log
- Defined in:
- lib/puppet/util/classgen.rb
Overview
This is a utility module for generating classes.
Constant Summary
Constants included from Puppet::Util
ALNUM, ALPHA, AbsolutePathPosix, AbsolutePathWindows, DEFAULT_POSIX_MODE, DEFAULT_WINDOWS_MODE, ESCAPED, HEX, HttpProxy, PUPPET_STACK_INSERTION_FRAME, RESERVED, RFC_3986_URI_REGEX, UNRESERVED, UNSAFE
Constants included from POSIX
POSIX::LOCALE_ENV_VARS, POSIX::USER_ENV_VARS
Constants included from SymbolicFileMode
SymbolicFileMode::SetGIDBit, SymbolicFileMode::SetUIDBit, SymbolicFileMode::StickyBit, SymbolicFileMode::SymbolicMode, SymbolicFileMode::SymbolicSpecialToBit
Instance Method Summary collapse
-
#genclass(name, options = {}, &block) ⇒ Class
Create a new class.
-
#genmodule(name, options = {}, &block) ⇒ Module
Creates a new module.
-
#rmclass(name, options) ⇒ Boolean
Removes an existing class.
Methods included from Puppet::Util
absolute_path?, benchmark, chuser, clear_environment, create_erb, default_env, deterministic_rand, deterministic_rand_int, exit_on_fail, format_backtrace_array, format_puppetstack_frame, get_env, get_environment, logmethods, merge_environment, path_to_uri, pretty_backtrace, replace_file, resolve_stackframe, rfc2396_escape, safe_posix_fork, set_env, skip_external_facts, symbolizehash, thinmark, uri_encode, uri_query_encode, uri_to_path, uri_unescape, which, withenv, withumask
Methods included from POSIX
#get_posix_field, #gid, groups_of, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid
Methods included from SymbolicFileMode
#display_mode, #normalize_symbolic_mode, #symbolic_mode_to_int, #valid_symbolic_mode?
Instance Method Details
#genclass(name, options = {}, &block) ⇒ Class
Create a new class.
33 34 35 |
# File 'lib/puppet/util/classgen.rb', line 33 def genclass(name, = {}, &block) genthing(name, Class, , block) end |
#genmodule(name, options = {}, &block) ⇒ Module
Creates a new module.
56 57 58 |
# File 'lib/puppet/util/classgen.rb', line 56 def genmodule(name, = {}, &block) genthing(name, Module, , block) end |
#rmclass(name, options) ⇒ Boolean
Removes an existing class.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/puppet/util/classgen.rb', line 66 def rmclass(name, ) const = genconst_string(name, ) retval = false if is_constant_defined?(const) remove_const(const) retval = true end hash = [:hash] if hash && hash.include?(name) hash.delete(name) retval = true end # Let them know whether we did actually delete a subclass. retval end |