<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby-gems/chef.git/spec/data/lwrp/resources/thumb_twiddler.rb, branch https</title>
<subtitle>github.com: opscode/chef.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/'/>
<entry>
<title>Chef-13: Chef::Resource cleanup</title>
<updated>2017-03-08T22:16:39+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2017-03-08T22:16:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=4650185d366874c175bd043d11fad6244ba33e6f'/>
<id>4650185d366874c175bd043d11fad6244ba33e6f</id>
<content type='text'>
most of this deletes useless old code.

the change to lookup_provider_constant changes to more strictly
stop using class name based lookups and to go through the resource
resolver and provider resolver.

as a result in order to find the provider class for a given dsl name
you have to go through the resource resolver to find the resource in
order to be able to pass a resource instance through the provider
resolver.  since the provider resolver api passes resources into blocks
passed into provides api you must construct a resource instance.

that means that providers need to be associated with resources in order
to be looked up (which makes sense in Real Life(tm) use of Chef, but
breaks quite a few lazy tests we had where we constructed providers
without doing the work of wrapping them in a resource.

note that as the deploy resource shows this filters into a changed
behavior of the `provider` syntax where before `provider :revision`
would look up Chef::Provider::Deploy::Revision via class-name based
magic.  this breaks that API so that `provider :deploy_revision` is
used instead -- the symbol (or string) there is turned into a resource
first via the Chef::ResourceResolver and then looked up via the
Chef::ProviderResolver into Chef::Provider::Deploy::Revision.  this
is a breaking change but is also a bug fix so that the symbol here
goes through the same lookup that you get when you type it in the DSL.

i had considered implementing a lookup from a resource_name symbol to
a provider, but in looking at how to implement that in the
ProviderResolver the issue is that we really need to have a resource
instance order to pass to the ProviderResolver.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
most of this deletes useless old code.

the change to lookup_provider_constant changes to more strictly
stop using class name based lookups and to go through the resource
resolver and provider resolver.

as a result in order to find the provider class for a given dsl name
you have to go through the resource resolver to find the resource in
order to be able to pass a resource instance through the provider
resolver.  since the provider resolver api passes resources into blocks
passed into provides api you must construct a resource instance.

that means that providers need to be associated with resources in order
to be looked up (which makes sense in Real Life(tm) use of Chef, but
breaks quite a few lazy tests we had where we constructed providers
without doing the work of wrapping them in a resource.

note that as the deploy resource shows this filters into a changed
behavior of the `provider` syntax where before `provider :revision`
would look up Chef::Provider::Deploy::Revision via class-name based
magic.  this breaks that API so that `provider :deploy_revision` is
used instead -- the symbol (or string) there is turned into a resource
first via the Chef::ResourceResolver and then looked up via the
Chef::ProviderResolver into Chef::Provider::Deploy::Revision.  this
is a breaking change but is also a bug fix so that the symbol here
goes through the same lookup that you get when you type it in the DSL.

i had considered implementing a lookup from a resource_name symbol to
a provider, but in looking at how to implement that in the
ProviderResolver the issue is that we really need to have a resource
instance order to pass to the ProviderResolver.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
