<commit_before>class ProgressBar
  module Components
    class Bar
      include Progressable

      DEFAULT_PROGRESS_MARK = '='

      attr_accessor :progress_mark
      attr_accessor :length

      def initialize(options = {})
        super

        self.progress_mark   = options[:progress_mark] || DEFAULT_PROGRESS_MARK
      end

      def to_s(options = {:format => :standard})
        completed_string = send(:"#{options[:format]}_complete_string")
        completed_string.ljust(length, ' ')
      end

      def integrated_percentage_complete_string
        return standard_complete_string if completed_length < 5

        " #{percentage_completed} ".to_s.center(completed_length, progress_mark)
      end

      def standard_complete_string
        progress_mark * completed_length
      end

      def empty_string
        ' ' * (length - completed_length)
      end

    private
      def completed_length
        length * percentage_completed / 100
      end
    end
  end
end<commit_msg>When dividing up the remainder of the length and determining how much space a completed bar should take up, round down so that the bar doesn't complete until 100%<commit_after>class ProgressBar
  module Components
    class Bar
      include Progressable

      DEFAULT_PROGRESS_MARK = '='

      attr_accessor :progress_mark
      attr_accessor :length

      def initialize(options = {})
        super

        self.progress_mark   = options[:progress_mark] || DEFAULT_PROGRESS_MARK
      end

      def to_s(options = {:format => :standard})
        completed_string = send(:"#{options[:format]}_complete_string")
        completed_string.ljust(length, ' ')
      end

      def integrated_percentage_complete_string
        return standard_complete_string if completed_length < 5

        " #{percentage_completed} ".to_s.center(completed_length, progress_mark)
      end

      def standard_complete_string
        progress_mark * completed_length
      end

      def empty_string
        ' ' * (length - completed_length)
      end

    private
      def completed_length
        (length * percentage_completed / 100).floor
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06577119036591014, 'fraction_numerical': 0.005094951366373321, 'mean_word_length': 2.6610169491525424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2344717', 'n_tokens_mistral': 604, 'n_tokens_neox': 566, 'n_words': 145}