<commit_before>module Blockpile
  module Setup
    def self.add_load_path(path)
      Dir.glob(path + "/**/*.rb") do |file|
        ActiveSupport::Dependencies.autoload_paths << File.dirname(file)
        file_name   = file.split(/\//).pop.gsub(/.rb/, '')
        class_name  = file_name.classify
        ActionView::Base.class_eval %{
          def #{file_name}(*args, &block)
              block = #{class_name}.new(self, session, params, '#{file_name}', *args)
              yield block
              raw block.to_html
          end
        }
      end
    end
  end
end<commit_msg>ensuring we don't yield a block if none given<commit_after>module Blockpile
  module Setup
    def self.add_load_path(path)
      Dir.glob(path + "/**/*.rb") do |file|
        ActiveSupport::Dependencies.autoload_paths << File.dirname(file)
        file_name   = file.split(/\//).pop.gsub(/.rb/, '')
        class_name  = file_name.classify
        ActionView::Base.class_eval %{
          def #{file_name}(*args, &block)
              blockpile = #{class_name}.new(self, session, params, '#{file_name}', *args)
              yield blockpile if block_given?
              raw blockpile.to_html
          end
        }
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13170731707317074, 'fraction_numerical': 0.0, 'mean_word_length': 2.116455696202532, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1642945', 'n_tokens_mistral': 392, 'n_tokens_neox': 382, 'n_words': 79}