lib/ridley/host_connector/winrm/worker.rb in ridley-0.12.3 vs lib/ridley/host_connector/winrm/worker.rb in ridley-0.12.4

- old
+ new

@@ -20,11 +20,11 @@ # @return [CommandUploader] attr_reader :command_uploader # @return [Array] attr_reader :command_uploaders - finalizer :finalizer + finalizer :finalize_callback EMBEDDED_RUBY_PATH = 'C:\opscode\chef\embedded\bin\ruby'.freeze # @param host [String] # the host the worker is going to work on @@ -40,14 +40,10 @@ @password = @options[:password] @winrm_endpoint = "http://#{host}:#{winrm_port}/wsman" @command_uploaders = Array.new end - def finalizer - command_uploaders.map(&:cleanup) - end - def run(command) response = Ridley::HostConnector::Response.new(host) command_uploaders << command_uploader = CommandUploader.new(winrm) command = get_command(command, command_uploader) @@ -149,9 +145,15 @@ # @return [#run] def ruby_script(command_lines) command = "#{EMBEDDED_RUBY_PATH} -e \"#{command_lines.join(';')}\"" run(command) end + + private + + def finalize_callback + command_uploaders.map(&:cleanup) + end end end end end