You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: bucket_sort.rb
    path of file: ./repos/Ruby/sorting
    
    the code of the file until where you have to start completion: DEFAULT_BUCKET_SIZE = 5

def bucket_sort(array, bucket_size = DEFAULT_BUCKET_SIZE)
  bucket_count = ((array.max - array.min) 
    
def bucket_sort(array, bucket_size = DEFAULT_BUCKET_SIZE)
  bucket_count = ((array.max - array.min) / bucket_size).floor + 1

  # create buckets
  buckets = []
  bucket_count.times { buckets.push [] }

  # fill buckets
  array.each do |item|
    buckets[((item - array.min) / bucket_size).floor].push(item)
  end

  # sort buckets
  buckets.each do |bucket|
    bucket.sort!
  end

  buckets.flatten
end