summaryrefslogtreecommitdiffstats
path: root/lib/puppet/dsl.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-10-03 19:36:35 -0500
committerLuke Kanies <luke@madstop.com>2007-10-03 19:36:35 -0500
commitbb3b3cedf4082dc884e41b864fa755057d20e228 (patch)
tree320cbf4056597adf7edb69d0f7442437d729cc77 /lib/puppet/dsl.rb
parent782bc4d3b037684f472e1db53c1878390b8c9a32 (diff)
downloadpuppet-bb3b3cedf4082dc884e41b864fa755057d20e228.tar.gz
puppet-bb3b3cedf4082dc884e41b864fa755057d20e228.tar.xz
puppet-bb3b3cedf4082dc884e41b864fa755057d20e228.zip
I finally tracked down the problem that was causing providers
to sometimes suddenly disappear and thus tests to fail -- Kernel.require was not loading the normal ruby path (e.g., 'puppet/type/cron'), so if someone else loaded that then it would replace the in-memory type with a new one, but that new one couldn't load its own providers, because the Kernel would ignore the providers, thinking they were already loaded. This doesn't fix all of the autoloading problems, but at least we won't suddenly break a ton of tests.
Diffstat (limited to 'lib/puppet/dsl.rb')
-rw-r--r--lib/puppet/dsl.rb104
1 files changed, 0 insertions, 104 deletions
diff --git a/lib/puppet/dsl.rb b/lib/puppet/dsl.rb
index 3696cd9ee..166745359 100644
--- a/lib/puppet/dsl.rb
+++ b/lib/puppet/dsl.rb
@@ -270,108 +270,4 @@ end
@aspects = {}
-class Puppet::DisabledDSL
- @@subs = {}
- @name = :DSLClass
- class << self
- include Enumerable
- attr_accessor :included, :name, :objects
-
- def each
- @@subs.each do |name, sub|
- yield name, sub
- end
- end
-
- def export
- bucket = nil
- if superclass() != Puppet::DSL
- bucket = superclass.export
- else
- bucket = Puppet::TransBucket.new
- bucket.keyword = "class"
- bucket.type = self.name
- end
-
- @objects.each do |type, ary|
- ary.each do |name, obj|
- if pobj = bucket.find { |sobj| obj.name == sobj.name && obj.type == sobj.type }
- obj.each do |param, value|
- pobj[param] = value
- end
- else
- bucket.push obj
- end
- end
- end
-
- return bucket
- end
-
- def include(name)
- if ary = @@subs.find { |n, s| n == name }
- ary[1].included = true
- else
- raise "Could not find class %s" % name
- end
- end
-
- def inherited(sub)
- name = sub.to_s.downcase.gsub(/.+::/, '').intern
- @@subs[name] = sub
- sub.name = name
- sub.initvars
-
- sub
- end
-
- def initvars
- #if superclass() == Puppet::DSL
- @objects = {}
- #else
- # @objects = superclass.objects
- #end
- end
-
-
- def import(file)
- text = File.read(file)
- # If they don't specify a parent class, then specify one
- # for them.
- text.gsub!(/^class \S+\s*$/) do |match|
- "#{match} < Puppet::DSL"
- end
- eval(text, binding)
- end
-
- def method_missing(method, *args)
- if klass = Puppet::Type.type(method)
- method = method.intern if method.is_a? String
- @objects[method] ||= {}
-
- names = args.shift
- hash = args.shift
- names = [names] unless names.is_a? Array
- names.each do |name|
- unless obj = @objects[method][name]
- obj = Puppet::TransObject.new(name, method)
- @objects[method][name] = obj
- end
-
- hash.each do |param, value|
- if obj[param]
- raise "Cannot override %s in %s[%s]" %
- [param, method, name]
- else
- obj[param] = value
- end
- end
- end
- else
- raise "No type %s" % method
- end
- end
- end
-end
-
# $Id$