<commit_before>module Merb
  module RepertoireCore
    module ApplicationHelper

      # @return a url to identify the given user's profile photo
      def gravatar_image_url(email, size=40)
        default_gravatar_uri = request.protocol + '://' request.host + public_path_for('images/gravatar.png')
        return default_gravatar_uri if email.nil?
        
        email_md5 = Digest::MD5.hexdigest(email)
        encoded_uri = URI.escape(default_gravatar_uri, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
        "http://www.gravatar.com/avatar.php?gravatar_id=#{email_md5}&default=#{encoded_uri}&size=#{size}" 
      end

      # @param *segments<Array[#to_s]> Path segments to append.
      #
      # @return <String> 
      #  A path relative to the public directory, with added segments.
      def image_path(*segments)
        public_path_for(:image, *segments)
      end
      
      # @param *segments<Array[#to_s]> Path segments to append.
      #
      # @return <String> 
      #  A path relative to the public directory, with added segments.
      def javascript_path(*segments)
        public_path_for(:javascript, *segments)
      end
      
      # @param *segments<Array[#to_s]> Path segments to append.
      #
      # @return <String> 
      #  A path relative to the public directory, with added segments.
      def stylesheet_path(*segments)
        public_path_for(:stylesheet, *segments)
      end<commit_msg>Correct gravitar url encoding<commit_after>module Merb
  module RepertoireCore
    module ApplicationHelper

      # @return a url to identify the given user's profile photo
      def gravatar_image_url(email, size=40)
        default_gravatar_uri = request.protocol + '://' + request.host + public_path_for('images/gravatar.png')
        return default_gravatar_uri if email.nil?
        
        email_md5 = Digest::MD5.hexdigest(email)
        encoded_uri = URI.escape(default_gravatar_uri, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
        "http://www.gravatar.com/avatar.php?gravatar_id=#{email_md5}&default=#{encoded_uri}&size=#{size}" 
      end

      # @param *segments<Array[#to_s]> Path segments to append.
      #
      # @return <String> 
      #  A path relative to the public directory, with added segments.
      def image_path(*segments)
        public_path_for(:image, *segments)
      end
      
      # @param *segments<Array[#to_s]> Path segments to append.
      #
      # @return <String> 
      #  A path relative to the public directory, with added segments.
      def javascript_path(*segments)
        public_path_for(:javascript, *segments)
      end
      
      # @param *segments<Array[#to_s]> Path segments to append.
      #
      # @return <String> 
      #  A path relative to the public directory, with added segments.
      def stylesheet_path(*segments)
        public_path_for(:stylesheet, *segments)
      end
{'fraction_non_alphanumeric': 0.10630193905817174, 'fraction_numerical': 0.0034626038781163434, 'mean_word_length': 2.8674698795180724, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3724835', 'n_tokens_mistral': 897, 'n_tokens_neox': 871, 'n_words': 208}