Does not seem to work with chef v11.10.0 due to Chef::RunContext requiring an events argument.
@chr0n1x, here's one that works in latest Chef:
ruby_block 'run_my_template_resource' do
r = Chef::Resource::Template.new('template_name', run_context)
r.variables my: 'variables'
@JeanMertz I found this while i was looking for a solution to one of my own problems with RemoteFile. By your example it feels like i should be able to do this:
ruby_block "parse-json" do
f = Chef::Provider::File::RemoteFile.new("/tmp/googlebackup", run_context)
but all i get is this error:
[2014-03-28T14:26:08+00:00] ERROR: ruby_block[parse-json] (/tmp/kitchen/cookbooks/jenkins_build_artefact/providers/default.rb line 16) had an error: NoMethodError: No resource or method named `source' for `Chef::Provider::RemoteFile ""'
@mansona in my example, I instantiate the Resource instead of the Provider: