<commit_before># frozen_string_literal: true
# Debian::AptPkg::Package file
module Debian
  # AptPkg base module
  module AptPkg
    # Debian::AptPkg::Package class
    # Representation of a package in a cache
    class Package
      attr_accessor :id, :name, :full_name, :arch, :essential, :important,
        :current_version

      # Initialize the Package class
      # @example
      #   new(id, name, full_name, arch, essential, important, current_version)
      # @param [Integer] The numeric ID of the package
      # @param [String] The name of the package
      # @param [String] Get the full name of the package, including the
      #                 architecture
      # @param [String] The architecture of the package
      # @param [Boolean] Boolean value determining whether the package is
      #                  essential
      # @param [Boolean] Boolean value determining whether the package has the
      #                 'important' flag set
      #                 ('Important: yes' in the Packages file)
      # @param [Version,NilClass] The version of the package currently installed
      #                           or `nil`
      # @return [Package] Package instance
      def initialize(id, name, full_name, arch, essential, important, current_version)
        @id = id
        @name = name
        @full_name = full_name
        @arch = arch
        @essential = essential
        @important = important
        @current_version = current_version
      end

      # Return `true` if the package is installed
      # @return [Boolean]
      def is_installed
        return false unless current_version

        true
      end
    end
  end
end
<commit_msg>Switch debian/apt_pkg/package to rdoc<commit_after># frozen_string_literal: true
# Debian::AptPkg::Package file
module Debian
  # AptPkg base module
  module AptPkg
    # Debian::AptPkg::Package class
    # Representation of a package in a cache
    class Package
      attr_accessor :id, :name, :full_name, :arch, :essential, :important,
        :current_version

      # Initialize the Package class
      #
      #   new(42, "ed", "ed:amd64", "amd64", false, false, nil)
      #
      # +id+:: [Integer] The numeric ID of the package
      #
      # +name+:: [String] The name of the package
      #
      # +full_name+:: [String] Get the full name of the package, including the
      #                        architecture
      #
      # +arch+:: [String] The architecture of the package
      #
      # +essential+:: [Boolean] Boolean value determining whether the package is
      #                         essential
      #
      # +important+:: [Boolean] Boolean value determining whether the package
      #                         has the 'important' flag set ('Important: yes'
      #                         in the Packages file)
      #
      # +current_version+:: [Version,NilClass] The version of the package
      #                                        currently installed or nil
      #
      # Returns a Package instance
      def initialize(id, name, full_name, arch, essential, important,
                     current_version)
        @id = id
        @name = name
        @full_name = full_name
        @arch = arch
        @essential = essential
        @important = important
        @current_version = current_version
      end

      # Return +true+ if the package is installed
      #
      #   Debian::AptPkg::Package.new(id, pkg_name, full_name, arch,
      #                               essential, important,
      #                               current_version).is_installed # => true
      def is_installed
        return false unless current_version

        true
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07727517501346258, 'fraction_numerical': 0.0016155088852988692, 'mean_word_length': 1.9114420062695925, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6619720', 'n_tokens_mistral': 983, 'n_tokens_neox': 951, 'n_words': 336}