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: import.rb
    path of file: ./repos/discourse/script/import_scripts/socialcast
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

requir
    
  def import_messages
    topics = 0
    imported = 0
    total = count_files(MESSAGES_DIR)
    Dir.foreach(MESSAGES_DIR) do |filename|
      next if filename == (".") || filename == ("..")
      topics += 1
      message_json = File.read MESSAGES_DIR + "/" + filename
      message = SocialcastMessage.new(message_json)
      next unless message.title
      created_topic = import_topic message.topic
      import_posts message.replies, created_topic.topic_id if created_topic
      imported += 1
      print_status topics, total
    end
    puts "", "Imported #{imported} topics. Skipped #{total - imported}."
  end