Hello,

I recently run into some problems trying some meta-programming with 
constants in a Puppet custom type. It looks like puppet does something with 
the Constants lookup path. I noticed this by checking the Module.nesting 
function. I should return an Array of the current search path for classes. 
Let me show you what happens.

module A
  puts Module.nesting
end

shows A like it should

Now if we change A for Puppet:

module Puppet
  puts Module.nesting
end

it shows Puppet, like it should

Now if we require puppet:

require 'puppet'
module Puppet
  puts Module.nesting
end

I get:

<module:Puppet>': undefined method `nesting' for Puppet::Module:Class 
(NoMethodError) 

I think this issue is the root cause of some problems I have referencing 
constants in other modules in my custom type code. Did any one ever notice 
this before? I've checked this behaviour on ruby 1.8.7 and 2.0.

Regards,

Bert



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/64481751-f74b-48c5-be95-276e68c35a12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to