<commit_before>require 'resourceful/builder'
require 'resourceful/base'

module Resourceful
  module Maker
    def make_resourceful(*args, &block)
      include Resourceful::Base

      builder = Resourceful::Builder.new
      builder.instance_eval(&block)
      builder.apply(self)
    end

    def before(action)
      resourceful_fire("before_#{action}".intern)
    end

    def after(action)
      resourceful_fire("after_#{action}".intern)
    end

    def response_for(action)
      respond_to do |format|
        read_inheritable_attribute(:resourceful_responses)[action.to_sym].each do |key, value|
          format.send(key, scope(value))
        end
      end
    end

    def resourceful_fire(callback_name)
      scope(read_inheritable_attribute(:resourceful_callbacks)[callback_name]).call
    end

    private

    def scope(&block)
      Proc.new { |*args, &block| instance_eval(&proc) }
    end<commit_msg>Fixed syntax error (stupid syntax error!).<commit_after>require 'resourceful/builder'
require 'resourceful/base'

module Resourceful
  module Maker
    def make_resourceful(*args, &block)
      include Resourceful::Base

      builder = Resourceful::Builder.new
      builder.instance_eval(&block)
      builder.apply(self)
    end

    def before(action)
      resourceful_fire("before_#{action}".intern)
    end

    def after(action)
      resourceful_fire("after_#{action}".intern)
    end

    def response_for(action)
      respond_to do |format|
        read_inheritable_attribute(:resourceful_responses)[action.to_sym].each do |key, value|
          format.send(key, scope(value))
        end
      end
    end

    private

    def resourceful_fire(callback_name)
      scope(read_inheritable_attribute(:resourceful_callbacks)[callback_name]).call
    end

    def scope(&block)
      Proc.new { instance_eval(&proc) }
    end
{'fraction_non_alphanumeric': 0.09746903607969844, 'fraction_numerical': 0.0, 'mean_word_length': 3.2909930715935336, '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': '1517839', 'n_tokens_mistral': 561, 'n_tokens_neox': 545, 'n_words': 106}