<commit_before># encoding: utf-8

module TTY
  class Command
    # Encapsulates the information on the command executed
    #
    # @api public
    class Result
      include Enumerable

      def initialize(status, out, err)
        @status = status
        @out    = out
        @err    = err
      end

      # Enumerate over output lines
      #
      # @api public
      def each(separator = nil)
        sep = separator || TTY::Command.record_separator
        return unless @out
        elements = @out.split(sep)
        if block_given?
          elements.each { |line| yield(line) }
        else
          elements.to_enum
        end
      end

      # All data written out to process's stdout stream
      def out
        @out
      end
      alias :stdout :out

      # All data written out to process's stdin stream
      def err
        @err
      end
      alias :stderr :err

      # Information on how the process exited
      #
      # @api public
      def exit_status
        @status
      end
      alias :exitstatus :exit_status
      alias :status :exit_status

      def to_i
        @status
      end

      def to_s
        @status.to_s
      end

      def to_ary
        [@out, @err]
      end

      def exited?
        @status != nil
      end
      alias :complete? :exited?

      def success?
        if exited?
          @status == 0
        else
          false
        end
      end

      def failure?
        !success?
      end
      alias :failed? :failure?

      def ==(other)
        return false unless other.is_a?(TTY::Command::Result)
        @status == other.to_i && to_ary == other.to_ary
      end
    end # Result
  end # Command
end # TTY<commit_msg>Change to clean up and fix aliases.<commit_after># encoding: utf-8

module TTY
  class Command
    # Encapsulates the information on the command executed
    #
    # @api public
    class Result
      include Enumerable

      # All data written out to process's stdout stream
      attr_reader :out
      alias stdout out

      # All data written out to process's stdin stream
      attr_reader :err
      alias stderr err

      def initialize(status, out, err)
        @status = status
        @out    = out
        @err    = err
      end

      # Enumerate over output lines
      #
      # @api public
      def each(separator = nil)
        sep = separator || TTY::Command.record_separator
        return unless @out
        elements = @out.split(sep)
        if block_given?
          elements.each { |line| yield(line) }
        else
          elements.to_enum
        end
      end

      # Information on how the process exited
      #
      # @api public
      def exit_status
        @status
      end
      alias exitstatus exit_status
      alias status exit_status

      def to_i
        @status
      end

      def to_s
        @status.to_s
      end

      def to_ary
        [@out, @err]
      end

      def exited?
        @status != nil
      end
      alias complete? exited?

      def success?
        exited? ?  @status.zero? : false
      end

      def failure?
        !success?
      end
      alias failed? failure?

      def ==(other)
        return false unless other.is_a?(TTY::Command::Result)
        @status == other.to_i && to_ary == other.to_ary
      end
    end # Result
  end # Command
end # TTY
{'fraction_non_alphanumeric': 0.06852184320766008, 'fraction_numerical': 0.0008976660682226212, 'mean_word_length': 1.5383447228549734, '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': '1748535', 'n_tokens_mistral': 984, 'n_tokens_neox': 938, 'n_words': 317}