<commit_before>module FeedzirraPodcast
  module Parser
    class RSS2Item
      include SAXMachine
      include Feedzirra::FeedEntryUtilities

      # RSS 2.0 required

      element :title
      element :description

      # RSS 2.0 optional

      element :link
      element :author
      element :pubDate, as: :pubDateString
      element :source, as: :source_title
      element :source, as: :source_url, value: :url
      elements :category, as: :categories
      element :guid # isPermalink might be a thing
      element :enclosure, as: :enclosure_url, value: :url
      element :enclosure, as: :enclosure_length, value: :length
      element :enclosure, as: :enclosure_type, value: :type

      element :comments

      def pubDate
        Time.parse(pubDateString).utc if pubDateString.present?
      rescue ArgumentError
        nil
      end

      def source
        Struct.new(:title, :url).new(source_title, source_url)
      end

      def enclosure
        Struct.new(:url, :type, :length).new(enclosure_url, enclosure_length.try(:to_f), enclosure_type)
      end
    end
  end
end<commit_msg>rename pub date string variable<commit_after>module FeedzirraPodcast
  module Parser
    class RSS2Item
      include SAXMachine
      include Feedzirra::FeedEntryUtilities

      # RSS 2.0 required

      element :title
      element :description

      # RSS 2.0 optional

      element :link
      element :author
      element :pubDate, as: :pub_date_string
      element :source, as: :source_title
      element :source, as: :source_url, value: :url
      elements :category, as: :categories
      element :guid # isPermalink might be a thing
      element :enclosure, as: :enclosure_url, value: :url
      element :enclosure, as: :enclosure_length, value: :length
      element :enclosure, as: :enclosure_type, value: :type

      element :comments

      def pubDate
        Time.parse(pub_date_string).utc if pub_date_string.present?
      rescue ArgumentError
        nil
      end

      def source
        Struct.new(:title, :url).new(source_title, source_url)
      end

      def enclosure
        Struct.new(:url, :type, :length).new(enclosure_url, enclosure_length.try(:to_f), enclosure_type)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0792520035618878, 'fraction_numerical': 0.004452359750667854, 'mean_word_length': 2.6775777414075286, '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': '964349', 'n_tokens_mistral': 687, 'n_tokens_neox': 655, 'n_words': 193}