<commit_before>module VagrantPlugins
  module FileUpload
    class Provisioner < Vagrant.plugin("2", :provisioner)
      def provision
        @machine.communicate.tap do |comm|
          # Make sure the remote path exists
          command = "mkdir -p %s" % File.dirname(config.destination)
          comm.execute(command) 

          # now upload the file
          comm.upload(File.expand_path(config.source), config.destination)
        end
      end
    end
  end
end<commit_msg>provisioners/file: expand destination path if capable<commit_after>module VagrantPlugins
  module FileUpload
    class Provisioner < Vagrant.plugin("2", :provisioner)
      def provision
        @machine.communicate.tap do |comm|
          destination = expand_guest_path(config.destination)

          # Make sure the remote path exists
          command = "mkdir -p %s" % File.dirname(destination)
          comm.execute(command)

          # now upload the file
          comm.upload(File.expand_path(config.source), destination)
        end
      end

      private

      # Expand the guest path if the guest has the capability
      def expand_guest_path(destination)
        if machine.guest.capability?(:shell_expand_guest_path)
          machine.guest.capability(:shell_expand_guest_path, destination)
        else
          destination
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0723155588020453, 'fraction_numerical': 0.0014609203798392988, 'mean_word_length': 2.4164588528678306, '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': '7544926', 'n_tokens_mistral': 383, 'n_tokens_neox': 372, 'n_words': 99}