<commit_before>require "active_support/concern"
require "authem/support"

module Authem
  module Controller
    extend ActiveSupport::Concern

    included{ class_attribute :authem_settings }

    module SessionManagementMethods
      def sign_in(model, options={})
        role = options.fetch(:as){ self.class.authem.role_for(model) }
        public_send "sign_in_#{role}", model
      end

      def sign_out(model, options={})
        role = options.fetch(:as){ self.class.authem.role_for(model) }
        public_send "sign_out_#{role}"
      end

      def clear_all_sessions_for(model, options={})
        role = options.fetch(:as){ self.class.authem.role_for(model) }
        public_send "clear_all_#{role}_sessions_for", model
      end
    end

    module ClassMethods
      def authem_for(model_name, options={})
        include SessionManagementMethods
<commit_msg>use ruby 2 goodness<commit_after>require "active_support/concern"
require "authem/support"

module Authem
  module Controller
    extend ActiveSupport::Concern

    included{ class_attribute :authem_settings }

    module SessionManagementMethods
      def sign_in(model, **options)
        role = options.fetch(:as){ self.class.authem.role_for(model) }
        public_send "sign_in_#{role}", model
      end

      def sign_out(model, **options)
        role = options.fetch(:as){ self.class.authem.role_for(model) }
        public_send "sign_out_#{role}"
      end

      def clear_all_sessions_for(model, **options)
        role = options.fetch(:as){ self.class.authem.role_for(model) }
        public_send "clear_all_#{role}_sessions_for", model
      end
    end

    module ClassMethods
      def authem_for(model_name, **options)
        include SessionManagementMethods

{'fraction_non_alphanumeric': 0.10148232611174458, 'fraction_numerical': 0.0005701254275940707, 'mean_word_length': 3.3656716417910446, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6310363', 'n_tokens_mistral': 536, 'n_tokens_neox': 527, 'n_words': 107}