<commit_before>require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Ges < OmniAuth::Strategies::OAuth2

      #option :client_options, {
      #    :site =>  OAUTH_PROVIDER_URL,
      #    :authorize_url => "#{OAUTH_PROVIDER_URL}/oauth/authorize",
      #    :access_token_url => "#{OAUTH_PROVIDER_URL}/oauth/token"
      #}

      uid { raw_info['uri'] }

      info do
        {
            name: raw_info['name'],
            email: raw_info['email'],
            login: raw_info['login'],
            id: @raw_info['id'],
            uri: raw_info['uri'],
        }
      end

      extra do
        {
            'raw_info' => raw_info
        }
      end

      def raw_info
        @raw_info ||= access_token.get(options.client_options[:info_url]).parsed
      end
    end
  end
end<commit_msg>добавляем аватарку<commit_after>require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Ges < OmniAuth::Strategies::OAuth2

      #option :client_options, {
      #    :site =>  OAUTH_PROVIDER_URL,
      #    :authorize_url => "#{OAUTH_PROVIDER_URL}/oauth/authorize",
      #    :access_token_url => "#{OAUTH_PROVIDER_URL}/oauth/token"
      #}

      uid { raw_info['uri'] }

      info do
        {
            name: raw_info['name'],
            email: raw_info['email'],
            login: raw_info['login'],
            id: @raw_info['id'],
            uri: raw_info['uri'],
            image: raw_info['avatar']['thumb_24']['url'],
            avatar: raw_info['avatar']
        }
      end

      extra do
        {
            'raw_info' => raw_info
        }
      end

      def raw_info
        @raw_info ||= access_token.get(options.client_options[:info_url]).parsed
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12786697247706422, 'fraction_numerical': 0.0034403669724770644, 'mean_word_length': 1.947635135135135, 'pattern_counts': {'":': 0, '<': 5, '<?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': '752559', 'n_tokens_mistral': 590, 'n_tokens_neox': 580, 'n_words': 94}