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: cloudfront-signer.rb
    path of file: ./repos/cloudfront-signer/lib
    
    the code of the file until where you have to start completion: # A re-write of https://github.com/stlondemand/aws_cf_signer
#
require 'openssl'
require 'time'
require 'base64'
require 'cloudfront-signer/version'
require 'json'

module Aws
  module CF
    class Signer
      # Public non-inherita
    
      def self.build_url(original_subject, configuration_options = {}, policy_options = {})
        subject = original_subject.dup
        # If the url or stream path already has a query string parameter -
        # append to that.
        separator = subject =~ /\?/ ? '&' : '?'

        subject.gsub!(/\s/, '%20') if configuration_options[:remove_spaces]
        subject = URI.escape(subject) if configuration_options[:uri_escape]

        result = subject +
                 separator +
                 signed_params(subject, policy_options).collect do |key, value|
                   "#{key}=#{value}"
                 end.join('&')

        if configuration_options[:html_escape]
          return html_encode(result)
        else
          return result
        end
      end