<commit_before>require 'deploy/utility'

module Deploy
  module Commands
    include Deploy::Utility

    def build_image(repo, tag)
      if File.can_read? 'Dockerfile.erb'
        shout "Processing Dockerfile.erb with ERB"
        system('erb Dockerfile.erb > Dockerfile') || exit(1)
      end

      shout "Building Docker Image: #{repo}:#{tag}"
      command = "docker build -t #{repo}:#{tag} ."
      exit(1) unless system(command)
    end

    def create_deploy_zip_file
      # to create the archive correctly we must set up a fake git user
      shout "Creating fake local git user"
      system "git config user.name 'deploy'; git config user.email 'deploy'"

      shout "Creating deploy.zip"<commit_msg>Use the correct method to check for Dockerfile.erb.<commit_after>require 'deploy/utility'

module Deploy
  module Commands
    include Deploy::Utility

    def build_image(repo, tag)
      if File.readable? 'Dockerfile.erb'
        shout "Processing Dockerfile.erb with ERB"
        system('erb Dockerfile.erb > Dockerfile') || exit(1)
      end

      shout "Building Docker Image: #{repo}:#{tag}"
      command = "docker build -t #{repo}:#{tag} ."
      exit(1) unless system(command)
    end

    def create_deploy_zip_file
      # to create the archive correctly we must set up a fake git user
      shout "Creating fake local git user"
      system "git config user.name 'deploy'; git config user.email 'deploy'"

      shout "Creating deploy.zip"
{'fraction_non_alphanumeric': 0.09686221009549795, 'fraction_numerical': 0.002728512960436562, 'mean_word_length': 3.0081967213114753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1422001', 'n_tokens_mistral': 456, 'n_tokens_neox': 435, 'n_words': 148}