Class: Net::SFTP::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_backup/extension/net_sftp_session.rb

Instance Method Summary collapse

Instance Method Details

#mkpath!(path, options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/easy_backup/extension/net_sftp_session.rb', line 4

def mkpath!(path, options={})
  path.split('/').inject(nil) do |previous, relative|
    current = previous ? "#{previous}/#{relative}" : relative
    mkdir! current, options if dir.glob('.', current).empty?
    current
  end
end