<commit_before># encoding: utf-8
class ApplicationDecorator < Draper::Base

  # TODO Armarlo con las funciones de tags para evitar el != en haml
  def hash_a_dl(*hash)
    clase = hash.extract_options!
    html = "<dl #{clase[:dl].present? ? "class='#{clase[:dl]}'" : nil}>"
    hash.first.each_pair do |dt, dd|
      html << "<dt #{clase[:dt].present? ? "class='#{clase[:dt]}'" : nil}>#{dt.humanize}</dt>"

      Array.wrap(dd).each do |item|
        html << "<dd #{clase[:dd].present? ? "class='#{clase[:dd]}'" : nil}>#{item}</dd>"
      end

    end
    html << '</dl>'
  end

end
<commit_msg>Convierto el decorador de hashes a definition list en content_tags<commit_after># encoding: utf-8
class ApplicationDecorator < Draper::Base

  def hash_a_dl(*hash)
    clase = hash.extract_options!
    h.content_tag(:dl, class: clase[:dl]) do
      hash.first.collect do |dt, dd|
        h.content_tag(:dt, class: clase[:dt]) { dt.humanize } +
        Array.wrap(dd).collect do |item|
          h.content_tag(:dd, class: clase[:dd]) { item }
        end.join.html_safe
      end.join.html_safe
    end
  end

end

{'fraction_non_alphanumeric': 0.17312894499549145, 'fraction_numerical': 0.0018034265103697023, 'mean_word_length': 3.236641221374046, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, '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': '5987111', 'n_tokens_mistral': 401, 'n_tokens_neox': 400, 'n_words': 93}