lib/rest/delete.rb
  Deletes the database and returns true on success
  After the removal of the database, the working-database might be empty
Deletes the database and returns true on success
After the removal of the database, the working-database might be empty
Deletes the database and returns true on success After the removal of the database the working - database might be empty
def delete_database database:
    logger.progname = 'RestDelete#DeleteDatabase'
    old_ds = ActiveOrient.database
    change_database database
    begin
  	  response = @res["/database/#{ActiveOrient.database}"].delete
  	  if database == old_ds
  	    change_database  'temp'
  	    logger.info{"Working database deleted, switched to temp"}
  	  else
  	    change_database old_ds
  	    logger.info{"Database #{database} deleted, working database is still #{ActiveOrient.database}"}
  	  end
    rescue RestClient::InternalServerError => e
      change_database old_ds
  	  logger.info{"Database #{database} NOT deleted, working database is still #{ActiveOrient.database}"}
    end
    !response.nil? && response.code == 204 ? true : false
  end
def delete_database database : logger . progname = 'RestDelete#DeleteDatabase' old_ds = ActiveOrient . database change_database database begin response = @res [ "/database/#{ActiveOrient.database}" ] . delete if database == old_ds change_database 'temp' logger . info { "Working database deleted, switched to temp" } else change_database old_ds logger . info { "Database #{database} deleted, working database is still #{ActiveOrient.database}" } end rescue RestClient :: InternalServerError => e change_database old_ds logger . info { "Database #{database} NOT deleted, working database is still #{ActiveOrient.database}" } end ! response . nil? && response . code == 204 ? true : false end
Deletes the database and returns true on success
After the removal of the database, the working-database might be empty
Deletes the database and returns true on success After the removal of the database the working - database might be empty
database
<not_specific>