<commit_before>PDFKit.configure do |config|
  config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
  config.default_options = {
    :disable_external_links => true,
    :disable_internal_links => true
  #   :page_size => 'Legal',
  #   :print_media_type => true
  }
  # config.root_url = "http://localhost" # Use only if your external hostname is unavailable on the server.
end

class PDFKit

  class Middleware
  
    private
    
    def set_request_to_render_as_pdf(env)
      @render_pdf = true
      path = @request.path.sub(%r{\.pdf$}, '')
      path = path.sub(@request.script_name, '') # Added
      %w[PATH_INFO REQUEST_URI].each { |e| env[e] = path }
      env['HTTP_ACCEPT'] = concat(env['HTTP_ACCEPT'], Rack::Mime.mime_type('.html'))
      env["Rack-Middleware-PDFKit"] = "true"
    end
    
  end
  <commit_msg>Whitespace<commit_after>PDFKit.configure do |config|
  config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
  config.default_options = {
    :disable_external_links => true,
    :disable_internal_links => true
    # :print_media_type => true,
    # :page_size => 'Legal'
  }
  # config.root_url = "http://localhost" # Use only if your external hostname is unavailable on the server.
end

class PDFKit

  class Middleware

    private

    def set_request_to_render_as_pdf(env)
      @render_pdf = true
      path = @request.path.sub(%r{\.pdf$}, '')
      path = path.sub(@request.script_name, '') # Added
      %w[PATH_INFO REQUEST_URI].each { |e| env[e] = path }
      env['HTTP_ACCEPT'] = concat(env['HTTP_ACCEPT'], Rack::Mime.mime_type('.html'))
      env["Rack-Middleware-PDFKit"] = "true"
    end

  end

{'fraction_non_alphanumeric': 0.14136447449293177, 'fraction_numerical': 0.0, 'mean_word_length': 3.3413333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5498858', 'n_tokens_mistral': 582, 'n_tokens_neox': 564, 'n_words': 108}