[chef-dev] Re: RE: Re: Re: Re: Re: ::File notation


Chronological Thread 
  • From: Jay Feldblum < >
  • To: Chef Dev < >
  • Subject: [chef-dev] Re: RE: Re: Re: Re: Re: ::File notation
  • Date: Wed, 17 Apr 2013 14:18:37 -0400

Adam,

I suspect that this is an annoyance for programmers who are fluent in Ruby and who want to write providers.

For example, if a provider requires reading a cache file in load_current_resource, the normal expectation is that File.read(cache_file_path) should work. It works in most other Ruby code, and programmers who are fluent in Ruby will have written that same line hundreds of times before. There is a perfectly sensible and easily comprehended reason why it doesn't this time, and there is a perfectly sensible and easily comprehended workaround with either ::File or IO.

This is not a blocker. But it is a speed bump.

In the name of avoiding all such speed bumps, the resource class could have been named `Chef::Resource::FileResource` and the provider class `Chef::Provider::FileProvider`. The same pattern could have been extended to all resource and provider classes as well.

Cheers,
Jay

On Wed, Apr 17, 2013 at 11:51 AM, Adam Jacob < " target="_blank"> > wrote:

Yeah – I’m not clear this is a problem in the vast majority of cases.

 

Adam

 




Archive powered by MHonArc 2.6.16.

§