Why am I unable to pass the cookbook as an instance variable to a library class ?
From: Daniel DeLeo <
">
>
Reply-To: " "> " < "> > Date: Monday, December 2, 2013 9:30 AM To: " "> " < "> > Subject: [chef] Re: Re: cookbook name as an attribute On Monday, December 2, 2013 at 9:28 AM, Adam Mielke wrote:
This won’t be true in library files, they are evaluated with Ruby’s `load` function so they don’t have the same contextual stuff that recipes do.
The best you can do here is look at `__FILE__` and infer the cookbook name from the file path.
--
Daniel DeLeo
|
Archive powered by MHonArc 2.6.16.