<commit_before>module GiveyRails
  class Donation
    include GiveyRails::GiveyModel

    validates_presence_of :amount

    def donated_entity
      channel || charity
    end

    def display_amount
      Money.new(amount, currency).cents / 100
    end

    def display_currency
      Money.new(amount, currency).currency
    end

    def donation_string_html
      if donation_string_textile =~ /time-\d+-time/
        str_amt       = donation_string_textile.match(/time-(\d+)-time/).captures[0].to_i
        time_str      = time_donation_format(str_amt)
        replaced_str  = donation_string_textile.gsub(/time-\d+-time/, time_str)
      else
        str_cur, str_amt  = donation_string_textile.match(/amt-([a-z]{3}|[A-Z]{3})(\d+)-amt/).captures
        money_object      = Money.new(str_amt, str_cur)
        replaced_str      = donation_string_textile.gsub(/amt-([a-z]{3}|[A-Z]{3})/, money_object.currency.symbol).gsub(/\d+-amt/, (money_object.cents / 100).to_s)
      end
      RedCloth.new(replaced_str, [:lite_mode]).to_html
    end

    def donation_images_html
      full_string = "div(avatar). " + donation_images_textile.join<commit_msg>images display<commit_after>module GiveyRails
  class Donation
    include GiveyRails::GiveyModel

    validates_presence_of :amount

    def donated_entity
      channel || charity
    end

    def display_amount
      Money.new(amount, currency).cents / 100
    end

    def display_currency
      Money.new(amount, currency).currency
    end

    def donation_string_html
      if donation_string_textile =~ /time-\d+-time/
        str_amt       = donation_string_textile.match(/time-(\d+)-time/).captures[0].to_i
        time_str      = time_donation_format(str_amt)
        replaced_str  = donation_string_textile.gsub(/time-\d+-time/, time_str)
      else
        str_cur, str_amt  = donation_string_textile.match(/amt-([a-z]{3}|[A-Z]{3})(\d+)-amt/).captures
        money_object      = Money.new(str_amt, str_cur)
        replaced_str      = donation_string_textile.gsub(/amt-([a-z]{3}|[A-Z]{3})/, money_object.currency.symbol).gsub(/\d+-amt/, (money_object.cents / 100).to_s)
      end
      RedCloth.new(replaced_str, [:lite_mode]).to_html
    end

    def donation_images_html
      full_string = donation_images_textile.map{|s| "div(avatar). " + s}.join("\n\n")
{'fraction_non_alphanumeric': 0.12693631669535285, 'fraction_numerical': 0.00946643717728055, 'mean_word_length': 2.914141414141414, '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': '2344183', 'n_tokens_mistral': 848, 'n_tokens_neox': 810, 'n_words': 115}