<commit_before>class ManualUpdateType
  def self.for(manual)
    new(manual).update_type
  end

  def initialize(manual)
    @manual = manual
  end

  def update_type
    # The first edition to be sent to the publishing api must always be sent as
    # a major update
    return "major" unless manual.has_ever_been_published?

    # Otherwise our update type status depends on the update type status
    # of our children if any of them are major we are major (and they
    # have to send a major for their first edition too).
    all_sections_are_minor? ? "minor" : "major"
  end

private

  attr_reader :manual

  def all_sections_are_minor?
    manual.
      sections.
      select(&:needs_exporting?).
      all? { |d|
        d.minor_update? && d.has_ever_been_published?
      }
  end
end<commit_msg>Rename local variable d -> s in ManualUpdateType<commit_after>class ManualUpdateType
  def self.for(manual)
    new(manual).update_type
  end

  def initialize(manual)
    @manual = manual
  end

  def update_type
    # The first edition to be sent to the publishing api must always be sent as
    # a major update
    return "major" unless manual.has_ever_been_published?

    # Otherwise our update type status depends on the update type status
    # of our children if any of them are major we are major (and they
    # have to send a major for their first edition too).
    all_sections_are_minor? ? "minor" : "major"
  end

private

  attr_reader :manual

  def all_sections_are_minor?
    manual.
      sections.
      select(&:needs_exporting?).
      all? { |s|
        s.minor_update? && s.has_ever_been_published?
      }
  end
end
{'fraction_non_alphanumeric': 0.06557377049180328, 'fraction_numerical': 0.0, 'mean_word_length': 2.9710843373493976, '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': '1335887', 'n_tokens_mistral': 524, 'n_tokens_neox': 484, 'n_words': 181}