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: config_loader.rb
    path of file: ./repos/nanoc/nanoc-core/lib/nanoc/core
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Nanoc
  module Core
    # @api private
    class ConfigLoader
      class NoConfigFileFoundError < ::Nanoc::Core::Error
        def initialize
          super('No configuration file found')
        end
      end

      class NoParentConfigFileFoundError < ::Nanoc::Core::Error
        def initialize(filename)
          super("There is no parent configuration file at #{filen
    
      def new_from_cwd
        # Determine path
        filename = self.class.config_filename_for_cwd
        raise NoConfigFileFoundError if filename.nil?

        # Read
        config =
          apply_parent_config(
            Nanoc::Core::Configuration.new(
              hash: load_file(filename),
              dir: File.dirname(filename),
            ),
            [filename],
          ).with_defaults

        # Load environment
        config.with_environment
      end