<commit_before>#module Applicat::Mvc::Controller
module Applicat
  module Mvc
    module Controller
      def self.included(base)
        base.class_eval do
          include RailsInfo::Controller::ExceptionDiagnostics
          
          include ErrorHandling
          include TransitionActions
          
          protect_from_forgery
             
          layout proc { |controller| controller.request.xhr? || !controller.params[:is_ajax_request].nil? ? false : 'application' }
           
          helper :all
          helper_method :controller_action?, :resource_exists?, :layout_presenter 

          def controller_action?(input_controller, input_action)
            if "#{input_controller}/#{input_action}" == "#{controller_name}/#{action_name}"
              return true
            else
              return false
            end
          end

          def resource_exists?(name)
            if eval("@#{name}.nil?") || (eval("@#{name}.class.name") != name.classify && eval("@#{name}.class.superclass.name") != name.classify) || eval("@#{name}.id.nil?")
              return false
            else
              return true
            end
          end<commit_msg>Removes rails_info dependency.<commit_after>#module Applicat::Mvc::Controller
module Applicat
  module Mvc
    module Controller
      def self.included(base)
        base.class_eval do
          include ErrorHandling
          include TransitionActions
          
          protect_from_forgery
             
          layout proc { |controller| controller.request.xhr? || !controller.params[:is_ajax_request].nil? ? false : 'application' }
           
          helper :all
          helper_method :controller_action?, :resource_exists?, :layout_presenter 

          def controller_action?(input_controller, input_action)
            if "#{input_controller}/#{input_action}" == "#{controller_name}/#{action_name}"
              return true
            else
              return false
            end
          end

          def resource_exists?(name)
            if eval("@#{name}.nil?") || (eval("@#{name}.class.name") != name.classify && eval("@#{name}.class.superclass.name") != name.classify) || eval("@#{name}.id.nil?")
              return false
            else
              return true
            end
          end
{'fraction_non_alphanumeric': 0.10856401384083045, 'fraction_numerical': 0.0, 'mean_word_length': 1.9768339768339769, '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': '2337742', 'n_tokens_mistral': 588, 'n_tokens_neox': 590, 'n_words': 121}