Class: ActiveStorageFtp::EnhanceFtp

Inherits:
Net::FTP
  • Object
show all
Defined in:
lib/active_storage_ftp/enhance_ftp.rb

Instance Method Summary collapse

Instance Method Details

#mkdir_p(remove_path) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/active_storage_ftp/enhance_ftp.rb', line 4

def mkdir_p(remove_path)
  paths = remove_path.split('/')
  full_path = paths.first == '~' ? '' : '/'
  paths.each do |path|
    full_path = File.join(full_path, path)
    begin
      mkdir(full_path)
    rescue
    end
  end
end