lib/ruby-box/client.rb in ruby-box-1.0.5 vs lib/ruby-box/client.rb in ruby-box-1.0.6

- old
+ new

@@ -53,16 +53,18 @@ def create_folder(path) folder = root_folder folder_names = split_path(path) folder_names.each do |folder_name| - new_folder = folder.folders(folder_name).first - begin - new_folder = folder.create_subfolder(folder_name) - rescue RubyBox::ItemNameInUse => e - new_folder = folder.folders(folder_name).first + new_folder = folder.folders(folder_name).first + if !new_folder + begin + new_folder = folder.create_subfolder(folder_name) + rescue RubyBox::ItemNameInUse => e + new_folder = folder.folders(folder_name).first + end end - folder = new_folder ? new_folder : folder.folders(folder_name).first + folder = new_folder end folder end def upload_data(path, data) \ No newline at end of file