Skip to content

Commit 0771135

Browse files
committed
Merge branch 'master' into 2.0
2 parents 37e3914 + c3d0013 commit 0771135

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/net/sftp/operations/upload.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module Net; module SFTP; module Operations
3131
# and their contents, recursively, to "/path/to/remote" on the remote server.
3232
#
3333
# For uploading a directory without creating it, do
34-
# sftp.upload!("/path/to/directory", "/path/to/remote", :create_dir => false)
34+
# sftp.upload!("/path/to/directory", "/path/to/remote", :mkdir => false)
3535
#
3636
# If you want to send data to a file on the remote server, but the data is
3737
# in memory, you can pass an IO object and upload it's contents:
@@ -160,7 +160,7 @@ def initialize(sftp, local, remote, options={}, &progress) #:nodoc:
160160
@remote_cwd = remote
161161

162162
@active += 1
163-
if @options[:create_dir]
163+
if @options[:mkdir]
164164
sftp.mkdir(remote) do |response|
165165
@active -= 1
166166
raise StatusException.new(response, "mkdir `#{remote}'") unless response.ok?

test/test_upload.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ def test_upload_directory_should_mirror_directory_structure_remotely
110110
prepare_directory
111111

112112
assert_scripted_command do
113-
sftp.upload("/path/to/local", "/path/to/remote")
113+
sftp.upload("/path/to/local", "/path/to/remote", :mkdir => true)
114114
end
115115
end
116116

117117
def test_upload_directory_with_handler_should_report_progress
118118
prepare_directory
119119

120120
assert_scripted_command do
121-
sftp.upload("/path/to/local", "/path/to/remote") { |*args| record_progress(args) }
121+
sftp.upload("/path/to/local", "/path/to/remote", :mkdir => true) { |*args| record_progress(args) }
122122
end
123123

124124
assert_progress_reported_open(:remote => "/path/to/remote/file1")
@@ -230,4 +230,4 @@ def expect_file_transfer(local, remote, data)
230230

231231
expect_file(local, data)
232232
end
233-
end
233+
end

0 commit comments

Comments
 (0)