- From: Noah Kantrowitz <
>
- To: Mike <
>
- Cc: Akzhan Abdulin <
>, Avishai Ish-Shalom <
>, Chef Dev <
>
- Subject: [chef-dev] Re: Re: Re: ::File notation
- Date: Tue, 16 Apr 2013 11:00:32 -0700
I think he is just stating that this is subpar, which is true. It is
definitely a place a lot of new Chef users get caught up, so maybe we should
consider renaming the Chef class so it doesn't conflict, at which point the
name would resolve normally. This would require special-casing something
somewhere I think, but perhaps it is worth it?
--Noah
On Apr 16, 2013, at 10:52 AM, Mike wrote:
>
So we're back to me not understanding the problem that Akzhan is stating.
>
>
On Tue, Apr 16, 2013 at 1:51 PM, Noah Kantrowitz
>
<
>
>
wrote:
>
> Yep, the issue is that recipe code is executed in the Chef::Recipe
>
> namespace, so "File" gets you Chef::File. Not sure there is a workaround
>
> given Ruby's structure for name lookups.
>
>
>
> --Noah
>
>
>
> On Apr 16, 2013, at 10:18 AM, Mike wrote:
>
>
>
>> I don't understand.
>
>>
>
>> By using ::File, aren't you guaranteeing that you're using the root
>
>> namespace?
>
>>
>
>> On Tue, Apr 16, 2013 at 12:56 PM, Akzhan Abdulin
>
>> <
>
>
>> wrote:
>
>>> Hello Chiefs,
>
>>>
>
>>> I have insight, - Chef classes should never be named as system ones.
>
>>>
>
>>> We need to eliminate ::File and so on notation.
>
>>>
>
>>> Yours sincerely,
>
>>> Akzhan.
>
>>>
>
>>>
>
>>> 2013/4/16 Avishai Ish-Shalom
>
>>> <
>
>
>>>>
>
>>>> inline_recipe "test" do
>
>>>>
>
>>>> block do
>
>>>> log "testing resource group"
>
>>>>
>
>>>> file "/tmp/test1" do
>
>>>>
>
>>>> mode "0600"
>
>>>>
>
>>>> end
>
>>>> end
>
>>>> action :nothing
>
>>>>
>
>>>> notifies :write, "log[test]"
>
>>>>
>
>>>> only_if { ::File.exists? "/tmp/test2" }
>
>>>>
>
>>>> end
>
>>>>
>
>>>>
>
>>>>
>
>>>> https://github.com/avishai-ish-shalom/chef-inline-recipe/blob/master/recipes/default.rb
>
>>>>
>
>>>>
>
>>>
>
>
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
- [chef-dev] ::File notation, Akzhan Abdulin, 04/16/2013
- [chef-dev] Re: ::File notation, Mike, 04/16/2013
- [chef-dev] Re: Re: ::File notation, Noah Kantrowitz, 04/16/2013
- [chef-dev] Re: Re: ::File notation, Mike, 04/16/2013
- [chef-dev] Re: Re: Re: ::File notation, Noah Kantrowitz, 04/16/2013
- [chef-dev] Re: Re: ::File notation, Akzhan Abdulin, 04/16/2013
- [chef-dev] Re: Re: Re: ::File notation, Noah Kantrowitz, 04/16/2013
- [chef-dev] Re: Re: Re: ::File notation, Akzhan Abdulin, 04/16/2013
- [chef-dev] Re: Re: Re: Re: ::File notation, Andrea Campi, 04/16/2013
- [chef-dev] Re: Re: Re: Re: Re: ::File notation, AJ Christensen, 04/16/2013
- [chef-dev] Re: Re: Re: Re: ::File notation, Akzhan Abdulin, 04/17/2013
- [chef-dev] RE: Re: Re: Re: Re: ::File notation, Adam Jacob, 04/17/2013
- [chef-dev] Re: RE: Re: Re: Re: Re: ::File notation, Jay Feldblum, 04/17/2013
- [chef-dev] Re: Re: RE: Re: Re: Re: Re: ::File notation, Jesse Campbell, 04/17/2013
- [chef-dev] RE: Re: Re: RE: Re: Re: Re: Re: ::File notation, Adam Jacob, 04/18/2013
Archive powered by MHonArc 2.6.16.