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: binary_count_trailing_zeroes.rb
    path of file: ./repos/Ruby/bit_manipulation
    
    the code of the file until where you have to start completion: def binary_count_trailing_zeroes(x)
  raise 'Input must be a positive integer' if x < 0

  binary = x.to_s(2)

  count = 0
  binary.chars.reverse_each do |char|

    
def binary_count_trailing_zeroes(x)
  raise 'Input must be a positive integer' if x < 0

  binary = x.to_s(2)

  count = 0
  binary.chars.reverse_each do |char|
    break if char == '1'

    count += 1
  end

  count
end