Method: Beaker::HostPrebuiltSteps#copy_file_to_remote
- Defined in:
- lib/beaker/host_prebuilt_steps.rb
#copy_file_to_remote(host, file_path, file_content) ⇒ Object
Create a file on host or hosts at the provided file path with the provided file contents.
166 167 168 169 170 171 172 173 174 |
# File 'lib/beaker/host_prebuilt_steps.rb', line 166 def copy_file_to_remote(host, file_path, file_content) block_on host do |host| Tempfile.open 'beaker' do |tempfile| File.open(tempfile.path, 'w') { |file| file.puts file_content } host.do_scp_to(tempfile.path, file_path, @options) end end end |