Method: Monster::Remote::Wrappers::NetFTPHandler#create_dir

Defined in:
lib/monster/remote/wrappers/net_ftp.rb

#create_dir(dir) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/monster/remote/wrappers/net_ftp.rb', line 32

def create_dir(dir)
  pwd = @ftp.pwd

  dirs = dirs_in_path(dir)
  root_dir_name = dirs.shift

  create_and_chdir(root_dir_name)

  if dirs.size > 0
    dirs.each do |dir|
      create_and_chdir(dir)
    end
  end

  @ftp.chdir(pwd)
end