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: file_tree.rb
    path of file: ./repos/CocoaPods/spec/integration
    
    the code of the file until where you have to start completion: require 'pathname'

module FileTree
  def to_tree(path, depth = 0)
    path = Pathname(path)
    indentation = ' ' * depth * 2
    tree = indentation << path.to_path << "\n"
    path.children.sort_by { |p| p.to_s.downcase }.each do |child|
    
    
  def to_tree(path, depth = 0)
    path = Pathname(path)
    indentation = ' ' * depth * 2
    tree = indentation << path.to_path << "\n"
    path.children.sort_by { |p| p.to_s.downcase }.each do |child|
      tree << to_tree(child, depth + 1)
    end if path.directory?
    tree
  end

  module_function :to_tree
end