I have a java/recipes/windows
recipe that uses a method called win_friendly_path
and it doesn't work because win_friendly_path
is not yet defined.
win_friendly_path
is however defined in the ../windows/libraries/windows_helper.rb
as follows:
module Windows
module Helper
def win_friendly_path(path)
path.gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR || '\\') if path
end
I already have my berksfile
and metadata.rb
setup in the java (./)
recipe to depend on the windows
cookbook.
I'm not sure how to include this module so right now I am trying to just use include WindowsHelper
in the java/cookbook/windows
recipe and receiving this error:
uninitialized constant #<Class:#<Chef::Recipe:0x00000000029a2188>>::WindowsHelper
I have tried several variations of this and now feel like I have spent way too much time troubleshooting the issue so any help is appreciated.
UPDATE: plugging in this line ::Chef::Resource.send(:include, Windows::Helper)
to my java/recipes/windows
recipe gives me the following error:
Chef::Exceptions::ValidationFailed
----------------------------------
value is a required property
Inserting the following line resolved this issue for me:
::Chef::Recipe.send(:include, Windows::Helper)
This allows me to use the variables following module from the windows cookbook:
module Windows
module Helper
...
{Variable}
{Other_variable}
...