<commit_before>require 'unfuddler'

module TicketMasterMod
  module Unfuddle
    class Ticket
      def self.create(ticket)
        Unfuddler.authenticate(ticket.project.authentication.to_hash)
        project = Unfuddler::Project.find(ticket.project.name)

        ticket = ticket.to_hash.select do |key, value|
          [:summary, :priority, :description].include?(key.to_sym)
        end
        ticket["priority"] = ticket["priority"].to_s

        project.ticket.create(ticket)<commit_msg>Ruby 1.8 fix<commit_after>require 'unfuddler'

module TicketMasterMod
  module Unfuddle
    class Ticket
      def self.create(ticket)
        Unfuddler.authenticate(ticket.project.authentication.to_hash)
        project = Unfuddler::Project.find(ticket.project.name)

        new_ticket = {}
        ticket.to_hash.each_pair do |key, value|
          new_ticket[key] = value if [:summary, :priority, :description].include?(key.to_sym)
          new_ticket[key] = value.to_s if value.is_a?(Integer)
        end

        project.ticket.create(new_ticket)
{'fraction_non_alphanumeric': 0.10687022900763359, 'fraction_numerical': 0.0019083969465648854, 'mean_word_length': 3.1626984126984126, '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': '5189253', 'n_tokens_mistral': 348, 'n_tokens_neox': 324, 'n_words': 56}