[chef] RE: including recipes vs normal ruby require/include


Chronological Thread 
  • From: < >
  • To: < >
  • Subject: [chef] RE: including recipes vs normal ruby require/include
  • Date: Thu, 16 Feb 2012 18:23:56 +0100

I have the same opinion, I prefer for complex staff, put most of code inside 
libraries of the cookbook and I keep recipe as thin as possible
The benefit I see is able to test in isolation without need of execution of 
chef-client, which is often quite slow. 

-----Mensaje original-----
De: 

 
[mailto:
 
Enviado el: jueves, 16 de febrero de 2012 16:09
Para: 

Asunto: [chef] including recipes vs normal ruby require/include


Chef folks,

I have a question about code reuse in Chef.

I know it’s not unusual for a recipe to include another recipe using the 
“include recipe” construct.  But  why is this better than using the normal 
Ruby mechanisms for code reuse?  Couldn’t I organize my reusable bits of Chef 
code into ordinary Ruby modules, and then use the ordinary Ruby require and 
include tools to pull in the reusable bits as needed?  My prejudice is to 
stick to the normal Ruby way unless there's a compelling reason not to.

Jeff

---------------------------------------------------------------------------
ADVERTENCIA LEGAL
Este mensaje se dirige exclusivamente a su destinatario y puede contener
informaci�n confidencial y/o sujeta al secreto profesional, cuya
divulgaci�n no est� permitida por la ley. Si no es vd. el destinatario de
este mensaje o lo ha recibido por error, queda informado de que la lectura,
utilizaci�n, divulgaci�n y/o copia de este mensaje, cualquiera que fuera su
finalidad, est� prohibida por la ley. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma v�a y
proceda a su destrucci�n. El correo electr�nico y las comunicaciones por
medio de Internet no permiten asegurar la confidencialidad de los mensajes
que se transmiten ni su integridad o correcta recepci�n. Si no consintiese
la utilizaci�n del correo electr�nico, le rogamos nos lo comunique de forma
inmediata. ING DIRECT no asume ninguna responsabilidad por estas
circunstancias.
---------------------------------------------------------------------------
LEGAL WARNING
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and/or protected by a professional
privilege, protected from disclosure by law. If you are not the intended
recipient or you have received it in error, you are hereby notified that
any read, dissemination, disclosure and/or copy of this message, for any
purpose, is strictly prohibited by law. If this message has been received
in error, please immediately notify us v�a e-mail and delete it. E-mail and
Internet do not guarantee the confidentiality, nor the completeness or
proper reception of the messages sent. Should you not agree to the use of
e-mail, you are kindly requested to notify us immediately. ING DIRECT does
not assume any liability for those circumstances.
---------------------------------------------------------------------------



Archive powered by MHonArc 2.6.16.

§