<commit_before>command :'download' do |c|
  c.syntax = 'xcode-installer download [options]'
  c.option '--dry-run', 'Enables a HEAD request instead of downloading the file'
  c.option '--release STRING', 'Used to specify an old or pre-release version of Xcode. Otherwise, latest GA release of Xcode is downloaded.'
  c.option '--pre-release', 'Specifies to download the latest pre-release version of Xcode.'
  c.summary = 'Initiates the download'
  c.description = ''

  c.action do |args, options|
    if options.release
      xcode_version = options.release
    else
      if options.pre_release
        xcode_version = XcodeInstaller::XcodeVersions::LATEST_DP
      else
        xcode_version = XcodeInstaller::XcodeVersions::LATEST_GA
      end
    end

    if XcodeInstaller::XcodeVersions::GUI.has_key?(xcode_version)
      xcode_url = XcodeInstaller::XcodeVersions::GUI[xcode_version]
    else
      puts "No Xcode release with number #{xcode_version}. Use the 'list' command to see a list of known releases."
      exit
    end

    puts "Downloading Xcode #{xcode_version}"
    puts xcode_url

    agent.verbose = options.verbose
    agent.dry_run = options.dry_run
    try {
      filename = agent.download(xcode_url)
      puts "File saved to: #{Dir.pwd}/#{filename}"
    }
  end
end
<commit_msg>Update download command to use new ReleaseManager to fix issues<commit_after>command :'download' do |c|
  c.syntax = 'xcode-installer download [options]'
  c.option '--dry-run', 'Enables a HEAD request instead of downloading the file'
  c.option '--release STRING', 'Used to specify an old or pre-release version of Xcode. Otherwise, latest GA release of Xcode is downloaded.'
  c.option '--pre-release', 'Specifies to download the latest pre-release version of Xcode.'
  c.summary = 'Initiates the download'
  c.description = ''

  c.action do |args, options|
    if options.release
      xcode_version = options.release
    else
      if options.pre_release
        xcode_version = XcodeInstaller::XcodeVersions::LATEST_DP
      else
        xcode_version = XcodeInstaller::XcodeVersions::LATEST_GA
      end
    end

    mgr = XcodeInstaller::XcodeVersions::ReleaseManager.new
    release = mgr.get_release(xcode_version, options.pre_release, 'gui')

    if release
      xcode_url = release['download_url']
    else
      puts "No Xcode release with number #{xcode_version}. Use the 'list' command to see a list of known releases."
      exit
    end

    puts "Downloading Xcode #{xcode_version}"
    puts xcode_url

    agent.verbose = options.verbose
    agent.dry_run = options.dry_run
    try {
      filename = agent.download(xcode_url)
      puts "File saved to: #{Dir.pwd}/#{filename}"
    }
  end
end

{'fraction_non_alphanumeric': 0.09371554575523705, 'fraction_numerical': 0.0, 'mean_word_length': 3.2731554160125587, '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': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7236122', 'n_tokens_mistral': 855, 'n_tokens_neox': 838, 'n_words': 253}