<commit_before># frozen_string_literal: true

require "version"

class PkgVersion
  include Comparable

  RX = /\A(.+?)(?:_(\d+))?\z/.freeze

  attr_reader :version, :revision

  def self.parse(path)
    _, version, revision = *path.match(RX)
    version = Version.create(version)
    new(version, revision.to_i)
  end

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

  def head?
    version.head?<commit_msg>pkg_version: delegate major, minor, patch methods to :version<commit_after># frozen_string_literal: true

require "version"

class PkgVersion
  include Comparable
  extend Forwardable

  RX = /\A(.+?)(?:_(\d+))?\z/.freeze

  attr_reader :version, :revision

  delegate [
    :major,
    :minor,
    :patch,
    :major_minor,
    :major_minor_patch,
  ] => :version

  def self.parse(path)
    _, version, revision = *path.match(RX)
    version = Version.create(version)
    new(version, revision.to_i)
  end

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

  def head?
    version.head?
{'fraction_non_alphanumeric': 0.12488436632747456, 'fraction_numerical': 0.0, 'mean_word_length': 3.416326530612245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2951739', 'n_tokens_mistral': 381, 'n_tokens_neox': 357, 'n_words': 85}