<commit_before>require 'cancan'

module MoulinRouge
  module CanCan
    class Ability
      include ::CanCan::Ability
      # Define all permissions collect by MoulinRouge
      def initialize(model)
        MoulinRouge.reload! unless MoulinRouge.configuration.cache
        # Set all permissions in main
        MoulinRouge::Permission.main.abilities.each do |ability|
          ability.send_to(self)
        end
        # Set all permissions by roles
        MoulinRouge::Permission.all.each do |role, permission|
          permission.abilities.each do |ability|
            ability.send_to(self)
          end if model.send(MoulinRouge.configuration.test_method, role)
        end
      end
    end
  end
end<commit_msg>Protecting the namespaces inside Ability<commit_after>require 'cancan'

module MoulinRouge
  module CanCan
    class Ability
      include ::CanCan::Ability
      # Define all permissions collect by MoulinRouge
      def initialize(model)
        ::MoulinRouge.reload! unless MoulinRouge.configuration.cache
        # Set all permissions in main
        ::MoulinRouge::Permission.main.abilities.each do |ability|
          ability.send_to(self)
        end
        # Set all permissions by roles
        ::MoulinRouge::Permission.all.each do |role, permission|
          permission.abilities.each do |ability|
            ability.send_to(self)
          end if model.send(::MoulinRouge.configuration.test_method, role)
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07022282241728561, 'fraction_numerical': 0.0, 'mean_word_length': 2.5710843373493977, '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': '4021415', 'n_tokens_mistral': 437, 'n_tokens_neox': 436, 'n_words': 109}