<commit_before># TODO - test if this works when src_files and dest_dir contain whitespace

module Gusteau
  module Rsync
    def default_rsync_opts
      "avz"
    end

    def sync_files(src_files, dest_dir, opts={})
      rsync_cmd = "rsync -#{opts[:rsync_opts] || default_rsync_opts} #{src_files.join(' ')} #{user}@#{host}:#{dest_dir}"
      log "#syncing local chef source files to remote dir ..." do
        @password ? system_using_password(rsync_cmd , @password) : system(rsync_cmd)
      end
    end

    private

    def system_using_password(cmd, password)
      system %{<commit_msg>2nd attempt to fix rsync not working on jenkins<commit_after># TODO - test if this works when src_files and dest_dir contain whitespace

module Gusteau
  module Rsync
    def default_rsync_opts
      "az"
    end

    def sync_files(src_files, dest_dir, opts={})
      rsync_cmd = "rsync -#{opts[:rsync_opts] || default_rsync_opts} #{src_files.join(' ')} #{user}@#{host}:#{dest_dir}"
      log "#syncing local chef source files to remote dir ..." do
        @password ? system_using_password(rsync_cmd , @password) : system(rsync_cmd)
      end
    end

    private

    def system_using_password(cmd, password)
      system %{
{'fraction_non_alphanumeric': 0.10647010647010648, 'fraction_numerical': 0.000819000819000819, 'mean_word_length': 3.443636363636364, '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': '6470572', 'n_tokens_mistral': 398, 'n_tokens_neox': 395, 'n_words': 110}