lib/ruby-box/client.rb in ruby-box-1.0.4 vs lib/ruby-box/client.rb in ruby-box-1.0.5
- old
+ new
@@ -54,10 +54,15 @@
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
- folder = new_folder ? new_folder : folder.create_subfolder(folder_name)
+ begin
+ new_folder = folder.create_subfolder(folder_name)
+ rescue RubyBox::ItemNameInUse => e
+ new_folder = folder.folders(folder_name).first
+ end
+ folder = new_folder ? new_folder : folder.folders(folder_name).first
end
folder
end
def upload_data(path, data)
\ No newline at end of file