<commit_before>require 'fastly'

module FastlyRails
  # A simple wrapper around the fastly-ruby client.
  class Client < DelegateClass(Fastly)
    def initialize(opts={})
      super(Fastly.new(opts))
    end

    def purge_by_key(key)
      client.require_key!
      client.post purge_url(key)
    end

    def purge_url(key)
      "/service/#{FastlyRails.service_id}/purge/#{key}"
    end
  end
end<commit_msg>fixing escaping on fastly-rails<commit_after>require 'fastly'
require 'uri'

module FastlyRails
  # A simple wrapper around the fastly-ruby client.
  class Client < DelegateClass(Fastly)
    def initialize(opts={})
      super(Fastly.new(opts))
    end

    def purge_by_key(key)
      client.require_key!
      client.post purge_url(key)
    end

    def purge_url(key)
      "/service/#{FastlyRails.service_id}/purge/#{URI.escape(key)}"
    end
  end
end
{'fraction_non_alphanumeric': 0.10599078341013825, 'fraction_numerical': 0.0, 'mean_word_length': 3.2598039215686274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2329888', 'n_tokens_mistral': 312, 'n_tokens_neox': 295, 'n_words': 64}