<commit_before>require "bosh/workspace"

module Bosh::Cli::Command
  class Prepare < Base
    include Bosh::Cli::Validation
    include Bosh::Workspace
    include ProjectDeploymentHelper
    include ReleaseHelper
    include StemcellHelper

    usage "prepare deployment"
    desc "Resolve deployment requirements"
    def prepare
      require_project_deployment
      auth_required
      nl
      prepare_release_repos
      nl
      prepare_releases
      nl
      prepare_stemcells
    end

    private

    def prepare_release_repos
      project_deployment_releases.each do |release|
        say "Cloning release '#{release.name.make_green}' to satisfy template references"
        release.update_repo
        msg = "Version '#{release.version.to_s.make_green}'"
        msg = "Ref '#{release.ref.make_green}'" if release.ref
        say "#{msg} has been checkout into: #{release.repo_dir}"
      end
    end

    def prepare_releases
      project_deployment_releases.each do |release|
        prepare_release(release)
      end
    end

    def prepare_release(release)
      if release_uploaded?(release.name, release.version)
        say "Release '#{release.name_version.make_green}' exists"
        say "Skipping upload"
      else<commit_msg>Split message over 2 lines<commit_after>require "bosh/workspace"

module Bosh::Cli::Command
  class Prepare < Base
    include Bosh::Cli::Validation
    include Bosh::Workspace
    include ProjectDeploymentHelper
    include ReleaseHelper
    include StemcellHelper

    usage "prepare deployment"
    desc "Resolve deployment requirements"
    def prepare
      require_project_deployment
      auth_required
      nl
      prepare_release_repos
      nl
      prepare_releases
      nl
      prepare_stemcells
    end

    private

    def prepare_release_repos
      project_deployment_releases.each do |release|
        say "Cloning release '#{release.name.make_green}' to satisfy template references"
        release.update_repo
        msg = "Version '#{release.version.to_s.make_green}'"
        msg = "Ref '#{release.ref.make_green}'" if release.ref
        say "#{msg} has been checkout into:"
        say "- #{release.repo_dir}"
      end
    end

    def prepare_releases
      project_deployment_releases.each do |release|
        prepare_release(release)
      end
    end

    def prepare_release(release)
      if release_uploaded?(release.name, release.version)
        say "Release '#{release.name_version.make_green}' exists"
        say "Skipping upload"
      else
{'fraction_non_alphanumeric': 0.07207562032296179, 'fraction_numerical': 0.00039385584875935406, 'mean_word_length': 2.836858006042296, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2992420', 'n_tokens_mistral': 728, 'n_tokens_neox': 694, 'n_words': 180}