<commit_before>module Api
  class MeController < BaseController
    doorkeeper_for :all

    def index
      @current_user = current_user
      respond_with @current_user
    end

    def update<commit_msg>Some docs for me controller<commit_after>module Api
  class MeController < BaseController
    doorkeeper_for :all

    resource_description do
      short_description 'Me resource'
      full_description 'Everything about the current user'
    end

    def_param_group :me do
      param :me, Hash, :required => true do
        param :first_name, String, :required => true
        param :last_name, String, :required => true
        param :email, String, :required => true
        param :password, String, :required => true
        param :password_confirmation, String, :required => true
      end
    end

    #######################################################################################

    api :GET, '/me'
    description 'Returns current user from the database'
    example File.read("#{Rails.root}/doc/api/users/show.json")
    example File.read("#{Rails.root}/doc/api/users/show.xml")

    def index
      @current_user = current_user
      respond_with @current_user
    end

    #######################################################################################

    api :PUT, '/me'
    description 'Updates the current user in the database'
    example File.read("#{Rails.root}/doc/api/users/update.json")
    example File.read("#{Rails.root}/doc/api/users/update.xml")
    param_group :me

    def update
      @current_user = current_user
      @current_user.update! user_params
      respond_with @current_user
    end

    #######################################################################################

    private

    def user_params
      params.required(:me).permit :first_name, :last_name, :email, :password, :password_confirmation
{'fraction_non_alphanumeric': 0.2175531914893617, 'fraction_numerical': 0.0, 'mean_word_length': 3.5434782608695654, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5432645', 'n_tokens_mistral': 500, 'n_tokens_neox': 480, 'n_words': 130}