vendored/puppet/lib/puppet/util/classgen.rb in bolt-0.20.3 vs vendored/puppet/lib/puppet/util/classgen.rb in bolt-0.20.5
- old
+ new
@@ -1,17 +1,14 @@
-require 'puppet/util/methodhelper'
-
module Puppet
class ConstantAlreadyDefined < Error; end
class SubclassAlreadyDefined < Error; end
end
# This is a utility module for generating classes.
# @api public
#
module Puppet::Util::ClassGen
- include Puppet::Util::MethodHelper
include Puppet::Util
# Create a new class.
# @param name [String] the name of the generated class
# @param options [Hash] a hash of options
@@ -64,11 +61,10 @@
# @param options [Hash] options
# @option options [Hash] :hash a hash of existing classes from which the class to be removed is also removed
# @return [Boolean] whether the class was removed or not
#
def rmclass(name, options)
- options = symbolize_options(options)
const = genconst_string(name, options)
retval = false
if is_constant_defined?(const)
remove_const(const)
retval = true
@@ -98,11 +94,9 @@
# This does the actual work of creating our class or module. It's just a
# slightly abstract version of genclass.
# @api private
def genthing(name, type, options, block)
- options = symbolize_options(options)
-
name = name.to_s.downcase.intern
if type == Module
#evalmethod = :module_eval
evalmethod = :class_eval