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: view_additions_rails6.rb
    path of file: ./repos/versioncake/lib/versioncake
    
    the code of the file until where you have to start completion: require 'action_view'

# register an addition detail for
    
  def extract_handler_and_format(path, default_formats)
    pieces = File.basename(path).split(".")
    pieces.shift

    extension = pieces.pop
    handler = ActionView::Template.handler_for_extension(extension)
    format  = get_format_from_pieces(pieces, Mime)

    [handler, format]
  end