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: magic-file.rb
    path of file: ./repos/artichoke/artichoke-backend/src/extn/stdlib/vendor/gen/irb
    
    the code of the file until where you have to start completion: # frozen_string_literal: false
module IRB
  class << (MagicFile = Object.new)
    # see p
    
    def detect_encoding(line)
      return unless line[0] == ?#
      line = line[1..-1]
      line = $1 if line[/-\*-\s*(.*?)\s*-*-$/]
      return nil unless ENCODING_SPEC_RE =~ line
      encoding = $1
      return encoding.sub(/-(?:mac|dos|unix)/i, '')
    end