# File lib/chef/provider/script.rb, line 31 def action_run script_file.puts(@code) script_file.close set_owner_and_group @new_resource.command("\"#{interpreter}\" #{flags} \"#{script_file.path}\"") super converge_by(nil) do # ensure script is unlinked at end of converge! unlink_script_file end end
# File lib/chef/provider/script.rb, line 64 def flags @new_resource.flags end
# File lib/chef/provider/script.rb, line 60 def interpreter @new_resource.interpreter end
# File lib/chef/provider/script.rb, line 52 def script_file @script_file ||= Tempfile.open("chef-script") end
# File lib/chef/provider/script.rb, line 45 def set_owner_and_group # FileUtils itself implements a no-op if +user+ or +group+ are nil # You can prove this by running FileUtils.chown(nil,nil,'/tmp/file') # as an unprivileged user. FileUtils.chown(@new_resource.user, @new_resource.group, script_file.path) end
Generated with the Darkfish Rdoc Generator 2.