<commit_before>class DeployCommands < Commands
  BUNDLE_PATH = File.join(Rails.root, "data", "bundler")

  delegate :fetch, to: :stack_commands

  def initialize(deploy)
    @deploy = deploy
    @stack = deploy.stack
  end

  def install_dependencies
    env = self.env.merge(deploy_spec.machine_env)
    deploy_spec.dependencies_steps.map do |command_line|
      Command.new(command_line, env: env, chdir: @deploy.working_directory)
    end
  end

  def deploy(commit)
    normalized_name = ActiveSupport::Inflector.transliterate(@deploy.author.name)
    env = self.env.merge(
      'SHA' => commit.sha,
      'ENVIRONMENT' => @stack.environment,
      'USER' => "#{@deploy.author.login} (#{normalized_name}) via Shipit 2",
      'EMAIL' => @deploy.author.email,
    ).merge(deploy_spec.machine_env)
    deploy_spec.deploy_steps.map do |command_line|
      Command.new(command_line, env: env, chdir: @deploy.working_directory)
    end
  end

  def checkout(commit)
    git("checkout", "-q", commit.sha, chdir: @deploy.working_directory)
  end

  def clone
    git("clone", "--local", @stack.git_path, @deploy.working_directory, chdir: @stack.deploys_path)
  end

  def deploy_spec
    @deploy_spec ||= DeploySpec.new(@deploy.working_directory, @stack.environment)
  end

  def stack_commands
    @stack_commands = StackCommands.new(@stack)
  end
end<commit_msg>add bundle path to environment<commit_after>class DeployCommands < Commands
  BUNDLE_PATH = File.join(Rails.root, "data", "bundler")

  delegate :fetch, to: :stack_commands

  def initialize(deploy)
    @deploy = deploy
    @stack = deploy.stack
  end

  def install_dependencies
    env = self.env.merge(deploy_spec.machine_env)
    deploy_spec.dependencies_steps.map do |command_line|
      Command.new(command_line, env: env, chdir: @deploy.working_directory)
    end
  end

  def deploy(commit)
    normalized_name = ActiveSupport::Inflector.transliterate(@deploy.author.name)
    env = self.env.merge(
      'SHA' => commit.sha,
      'ENVIRONMENT' => @stack.environment,
      'USER' => "#{@deploy.author.login} (#{normalized_name}) via Shipit 2",
      'EMAIL' => @deploy.author.email,
      'BUNDLE_PATH' => deploy_spec.BUNDLE_PATH,
    ).merge(deploy_spec.machine_env)
    deploy_spec.deploy_steps.map do |command_line|
      Command.new(command_line, env: env, chdir: @deploy.working_directory)
    end
  end

  def checkout(commit)
    git("checkout", "-q", commit.sha, chdir: @deploy.working_directory)
  end

  def clone
    git("clone", "--local", @stack.git_path, @deploy.working_directory, chdir: @stack.deploys_path)
  end

  def deploy_spec
    @deploy_spec ||= DeploySpec.new(@deploy.working_directory, @stack.environment)
  end

  def stack_commands
    @stack_commands = StackCommands.new(@stack)
  end
end
{'fraction_non_alphanumeric': 0.12405880243814987, 'fraction_numerical': 0.0007171029042667623, 'mean_word_length': 3.9732620320855614, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '7622177', 'n_tokens_mistral': 967, 'n_tokens_neox': 926, 'n_words': 185}