<commit_before>desc 'Build all release announcements.'
task :ann => %w[ ann:html ann:text ann:feed ]

# it has long been a tradition to use an "[ANN]" prefix
# when announcing things on the ruby-talk mailing list
@ann_subject_prefix = '[ANN] '

task :@ann_subject do
  unless @ann_subject
    @ann_subject = @ann_subject_prefix +
      @project_module::PROJECT + ' ' + @project_module::VERSION
  end
end

# fetch project description from manual
task :@ann_nfo_html_nodes do
  unless @ann_nfo_html_nodes
    begin
      head, body = fetch_nodes_between(
        'h2#_description + div', 'h1,h2,h3,h4,h5,h6'
      )
    rescue => error
      error.message.insert 0,
        "The manual lacks a <h2> DESCRIPTION heading.\n"
      raise error
    end

    @ann_nfo_html_nodes = body
  end
end

task :@ann_nfo_text do
  unless @ann_nfo_text
    Rake::Task[:@ann_nfo_html_nodes].invoke
    @ann_nfo_text = nodes_inner_text(@ann_nfo_html_nodes)
  end
end

# fetch release notes from manual
task :@ann_rel_html_body_nodes do
  unless @ann_rel_html_body_nodes
    begin
      head, body = fetch_nodes_between(
        'h2#_history + div > h3', 'h1,h2,h3'
      )
    rescue => error
      error.message.insert 0,<commit_msg>project description was not parsed correctly<commit_after>desc 'Build all release announcements.'
task :ann => %w[ ann:html ann:text ann:feed ]

# it has long been a tradition to use an "[ANN]" prefix
# when announcing things on the ruby-talk mailing list
@ann_subject_prefix = '[ANN] '

task :@ann_subject do
  unless @ann_subject
    @ann_subject = @ann_subject_prefix +
      @project_module::PROJECT + ' ' + @project_module::VERSION
  end
end

# fetch project description from manual
task :@ann_nfo_html_nodes do
  unless @ann_nfo_html_nodes
    begin
      head, body = fetch_nodes_between(
        'h2#_description + div.sectionbody > :first-child', 'h1,h2,h3,h4,h5,h6'
      )
      body.unshift head
    rescue => error
      error.message.insert 0,
        "The manual lacks a <h2> DESCRIPTION heading.\n"
      raise error
    end

    @ann_nfo_html_nodes = body
  end
end

task :@ann_nfo_text do
  unless @ann_nfo_text
    Rake::Task[:@ann_nfo_html_nodes].invoke
    @ann_nfo_text = nodes_inner_text(@ann_nfo_html_nodes)
  end
end

# fetch release notes from manual
task :@ann_rel_html_body_nodes do
  unless @ann_rel_html_body_nodes
    begin
      head, body = fetch_nodes_between(
        'h2#_history + div > h3', 'h1,h2,h3'
      )
    rescue => error
      error.message.insert 0,
{'fraction_non_alphanumeric': 0.09434713375796179, 'fraction_numerical': 0.01194267515923567, 'mean_word_length': 3.479500891265597, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '5973062', 'n_tokens_mistral': 897, 'n_tokens_neox': 874, 'n_words': 227}