<commit_before>require 'rubygems'

module TachikomaAi
  module Bundler
    class Gem
      STRING_PATTERN = /[-|\+]\s+(\S+)\s\((.+?)\)/
      major, minor = RUBY_VERSION.split('.')
      GEMS_PATH = "vendor/bundle/ruby/#{major}.#{minor}.0/gems/"

      attr_reader :name, :version
      attr_accessor :from

      def self.parse(s)
        m = s.match STRING_PATTERN
        new m[1], m[2]
      end

      def initialize(name, version)
        @name = name
        @version = version
      end

      def github?
        homepage.include? 'github'
      end

      def homepage
        @homepage ||= spec.homepage
      end

      def compare_url
        File.join homepage, 'compare', "v#{from}...v#{version}"
      end

      private

      def spec
        ::Gem::Specification::load(spec_path)
      end

      def spec_path
        "#{GEMS_PATH}/#{name}-#{versin}/#{name}.gemspec"
      end
    end
  end
end<commit_msg>Fix typo<commit_after>require 'rubygems'

module TachikomaAi
  module Bundler
    class Gem
      STRING_PATTERN = /[-|\+]\s+(\S+)\s\((.+?)\)/
      major, minor = RUBY_VERSION.split('.')
      GEMS_PATH = "vendor/bundle/ruby/#{major}.#{minor}.0/gems/"

      attr_reader :name, :version
      attr_accessor :from

      def self.parse(s)
        m = s.match STRING_PATTERN
        new m[1], m[2]
      end

      def initialize(name, version)
        @name = name
        @version = version
      end

      def github?
        homepage.include? 'github'
      end

      def homepage
        @homepage ||= spec.homepage
      end

      def compare_url
        File.join homepage, 'compare', "v#{from}...v#{version}"
      end

      private

      def spec
        ::Gem::Specification::load(spec_path)
      end

      def spec_path
        "#{GEMS_PATH}/#{name}-#{version}/#{name}.gemspec"
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13744588744588745, 'fraction_numerical': 0.003246753246753247, 'mean_word_length': 1.9072327044025157, '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': '7367904', 'n_tokens_mistral': 646, 'n_tokens_neox': 623, 'n_words': 132}