<commit_before># -*- encoding: utf-8 -*-

require 'rbconfig'

module TTY
  class System

    # Check if windows platform.
    #
    # @return [Boolean]
    #
    # @api public
    def self.windows?
      RbConfig::CONFIG['host_os'] =~ /msdos|mswin|djgpp|mingw|windows/
    end

    # Check if unix platform
    #
    # @return [Boolean]
    #
    # @api public
    def self.unix?
      RbConfig::CONFIG['host_os'] =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
    end

    # Find an executable in the PATH
    #
    # @see TTY::System::Which
    #
    # @api public
    def self.which(command)
      Which.new(command).which
    end

    # Check if command is available
    #
    # @param [String] name
    #   the command name
    #
    # @api public
    def self.exists?(name)
      !!self.which(name)
    end

    # Proxy to editor object
    #
    # @return [TTY::System::Editor]
    #
    # @api public
    def self.editor
      TTY::System::Editor
    end

  end # System
end # TTY
<commit_msg>Clean up system.<commit_after># encoding: utf-8

require 'rbconfig'

module TTY
  class System
    # Check if windows platform.
    #
    # @return [Boolean]
    #
    # @api public
    def self.windows?
      match_os?(/msdos|mswin|djgpp|mingw|windows/i)
    end

    # Check if unix platform
    #
    # @return [Boolean]
    #
    # @api public
    def self.unix?
      match_os?(/(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i)
    end

    # Check if platform matches given systems
    #
    # @return [Boolean]
    #
    # @api public
    def self.match_os?(matcher)
      !!(RbConfig::CONFIG['host_os'] =~ matcher)
    end

    # Find an executable in the PATH
    #
    # @see TTY::System::Which
    #
    # @api public
    def self.which(command)
      Which.new(command).which
    end

    # Check if command is available
    #
    # @param [String] name
    #   the command name
    #
    # @api public
    def self.exists?(name)
      !!which(name)
    end

    # Proxy to editor object
    #
    # @return [TTY::System::Editor]
    #
    # @api public
    def self.editor
      TTY::System::Editor
    end
  end # System
end # TTY

{'fraction_non_alphanumeric': 0.12402745995423341, 'fraction_numerical': 0.0009153318077803204, 'mean_word_length': 2.177325581395349, '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': '6913765', 'n_tokens_mistral': 786, 'n_tokens_neox': 764, 'n_words': 179}