Not sure if this is the problem or not, but I know in Ruby any variable name that starts with an uppercase letter is a constant.
-JL
Disclaimer: I am a Ruby newbie
Trying to follow the first option, i changed the following:
Moved the recipe function into a module
Included the module into the recipe
<code>
module LogLib
def logEvent(s)
stomp_server = @node[:stomp_server]
Chef::Log.info ("#{stomp_server}");
end
end
class Chef::Recipe::LOG
include LogLib
end
</code>
But when I invoke LOG.logEvent "custom event" from a different cookbook's
recipe for testing, I got an error:
NameError: uninitialized constant Chef::Recipe::LOG::LogLib
Archive powered by MHonArc 2.6.16.