On Fri, Jun 29, 2012 at 3:09 AM, David Schmitt <da...@dasz.at> wrote:
> On 29.06.2012 08:51, Brian Gupta wrote:
>>
>> According to the style guide,  "Classes and defined resource types
>> must not be defined within other classes."
>>
>> However looking at
>>
>> https://github.com/puppetlabs/puppetlabs-nginx/blob/master/manifests/init.pp
>> shows that there are a number of other classes defined in class nginx.
>>
>> What's the correct pattern? (And why?)
>>
>> Also can someone confirm the following class naming standards.:
>> 1) In init.pp, naming the main class associated with that module as
>> the same name as that module is best practice and will get applied,
>> when someone just does include modulename.
>> 2) For all classes that you want to include from other modules you
>> need to name them modulename::classname
>> 3) Other then option 1, one should avoid just using a simple classname
>> inside a module, but rather use modulename::classname. (Some
>> additional clarification here would be great.)
>
>
> These recommendations are rooted in the autoloader, who automatically finds
> modulename::some::class in modulename/manifests/some/class.pp.
>
> Additionally this improves orientation for others when reading or using the
> module because it ibues the names with meaning.

Thanks David. Could you clarify one thing?

The style guide says the following is bad:

"   class foo {
      ...
      class bar { ... }
    }"

I think this largely works, and will register as classes apache and
apache::ssl, but the correct style would be?:

class foo {
  ---
}
class foo::bar {
  ...
}

>
>
> Best Regards, David
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to