def install_configure_in(base)
      base.instance_eval <<-EOF
        # Configuration class for host module
        #
        #{base.name}::Configuration = Class.new(Configurations::Configuration)

        # The central configure method
        # @params [Proc] block the block to configure host module with
        # @raise [ArgumentError] error when not given a block
        # @example Configure a configuration
        #   MyGem.configure do |c|
        #     c.foo = :bar
        #   end
        #
        def self.configure(&block)
          semaphore.synchronize do
            fail ArgumentError, "configure needs a block" unless block_given?
            include_configuration_type!(#{base.name}::Configuration)

            set_configuration!(&block)
          end
        end

        # A reader for Configuration
        #
        def configuration
          semaphore.synchronize do
            return @configuration if @configuration

            if @configuration_defaults
              include_configuration_type!(#{base.name}::Configuration)
              set_configuration! { }
            end
          end
        end


        private

        # Sets the configuration instance variable
        #
        def self.set_configuration!(&block)
          @configuration = #{base.name}::Configuration.__new__(
                                                      configuration_options,
                                                      &block
                                                    )
        end

        @semaphore = Mutex.new
        def self.semaphore
          @semaphore
        end

      EOF
    end
def install_configure_in(base)
      base.instance_eval <<-EOF
        # Configuration class for host module
        #
        #{base.name}::Configuration = Class.new(Configurations::Configuration)

        # The central configure method
        # @params [Proc] block the block to configure host module with
        # @raise [ArgumentError] error when not given a block
        # @example Configure a configuration
        #   MyGem.configure do |c|
        #     c.foo = :bar
        #   end
        #
        def self.configure(&block)
          semaphore.synchronize do
            fail ArgumentError, "configure needs a block" unless block_given?
            include_configuration_type!(#{base.name}::Configuration)

            set_configuration!(&block)
          end
        end

        # A reader for Configuration
        #
        def configuration
          semaphore.synchronize do
            return @configuration if @configuration

            if @configuration_defaults
              include_configuration_type!(#{base.name}::Configuration)
              set_configuration! { }
            end
          end
        end


        private

        # Sets the configuration instance variable
        #
        def self.set_configuration!(&block)
          @configuration = #{base.name}::Configuration.__new__(
                                                      configuration_options,
                                                      &block
                                                    )
        end

        @semaphore = Mutex.new
        def self.semaphore
          @semaphore
        end

      EOF
    end
Installs #configure in base, and makes sure that it will instantiate
 configuration as a subclass of the host module