<commit_before>require "authentication/version"
require "authentication/authenticator"

module Authentication
  class Unauthenticated < StandardError; end

  def self.included(base)
    base.class_eval do
      extend Forwardable
      def_delegators :authenticator, :login!, :current_user, :current_user_id, :logged_in?, :logout!
    end
  end

  def authenticator
    @__authenticator ||= Authentication::Authenticator.new(
      session: session,
      session_key: :current_user_id,
      finder: -> { find_current_user }
    )
  end
end<commit_msg>Rename Authentication#authenticator to #current_user_authenticator<commit_after>require "authentication/version"
require "authentication/authenticator"

module Authentication
  class Unauthenticated < StandardError; end

  def self.included(base)
    base.class_eval do
      extend Forwardable
      def_delegators :current_user_authenticator, :login!, :current_user, :current_user_id, :logged_in?, :logout!
    end
  end

  # Return authenticator for `current_user`.
  #
  # @return [Authentication::Authenticator]
  def current_user_authenticator
    @__authenticator ||= Authentication::Authenticator.new(
      session: session,
      session_key: :current_user_id,
      finder: -> { find_current_user }
    )
  end
end
{'fraction_non_alphanumeric': 0.08528951486697965, 'fraction_numerical': 0.0, 'mean_word_length': 4.465811965811966, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4401014', 'n_tokens_mistral': 401, 'n_tokens_neox': 379, 'n_words': 82}