<commit_before>desc "Release a new project version"
task :release do
  require 'pathname'
  require 'yaml'
  require 'more_core_extensions/all'

  version = ENV["RELEASE_VERSION"]
  if version.nil? || version.empty?
    STDERR.puts "ERROR: You must set the env var RELEASE_VERSION to the proper value."
    exit 1
  end

  branch = `git rev-parse --abbrev-ref HEAD`.chomp
  if branch == "master"
    STDERR.puts "ERROR: You cannot cut a release from the master branch."
    exit 1
  end

  root = Pathname.new(__dir__).join("../..")

  # Modify the VERSION file
  version_file = root.join("VERSION")
  File.write(version_file, version)

  # Modify the automate domain version
  ae_file = root.join("db/fixtures/ae_datastore/ManageIQ/System/About.class/__class__.yaml")
  content = YAML.load_file(ae_file)
  content.store_path("object", "schema", 0, "field", "default_value", version)
  File.write(ae_file, content.to_yaml)

  # Create the commit and tag
  exit $?.exitstatus unless system("git add #{version_file} #{ae_file}")<commit_msg>Remove automate domain changes from rake release<commit_after>desc "Release a new project version"
task :release do
  require 'pathname'

  version = ENV["RELEASE_VERSION"]
  if version.nil? || version.empty?
    STDERR.puts "ERROR: You must set the env var RELEASE_VERSION to the proper value."
    exit 1
  end

  branch = `git rev-parse --abbrev-ref HEAD`.chomp
  if branch == "master"
    STDERR.puts "ERROR: You cannot cut a release from the master branch."
    exit 1
  end

  root = Pathname.new(__dir__).join("../..")

  # Modify the VERSION file
  version_file = root.join("VERSION")
  File.write(version_file, version)

  # Create the commit and tag
  exit $?.exitstatus unless system("git add #{version_file}")
{'fraction_non_alphanumeric': 0.11483797612279704, 'fraction_numerical': 0.0028425241614553724, 'mean_word_length': 3.8753462603878117, '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': '2812284', 'n_tokens_mistral': 585, 'n_tokens_neox': 559, 'n_words': 179}