<commit_before>module SifttterRedux
  #  ======================================================
  #  DBU Module
  #
  #  Wrapper module for the Dropbox Uploader project
  #  ======================================================
  module DBU
    DEFAULT_MESSAGE = 'RUNNING DROPBOX UPLOADER'

    #  ----------------------------------------------------
    #  download method
    #
    #  Downloads the files at the remote Dropbox filepath
    #  to a filepath on the local filesystem.
    #  @return Void
    #  ----------------------------------------------------
    def self.download
      if !@local_path.nil? && !@remote_path.nil?
        CliMessage.info_block(@message ||= DEFAULT_MESSAGE, 'Done.', SifttterRedux.verbose) do
          if SifttterRedux.verbose
            system "#{ @dbu } download #{ @remote_path } #{ @local_path }"
          else
            exec = `#{ @dbu } download #{ @remote_path } #{ @local_path }`
          end
        end
      else
        fail ArgumentError, 'Local and remote DBU targets cannot be nil'
      end
    end

    #  ----------------------------------------------------
    #  install_wizard method
    #
    #  Runs a wizard that installs Dropbox Uploader on the
    #  local filesystem.
    #  @return Void
    #  ----------------------------------------------------
    def self.install_wizard
      valid_directory_chosen = false

      CliMessage.section_block('CONFIGURING DROPBOX UPLOADER...') do
        until valid_directory_chosen
          # Prompt the user for a location to save Dropbox Uploader. '
          path = CliMessage.prompt('Location for Dropbox-Uploader', DBU_LOCAL_FILEPATH)
          path.chop! if path.end_with?('/')
          path = '/usr/local/opt' if path.empty?

          # If the entered directory exists, clone the repository.
          if File.directory?(path)
            valid_directory_chosen = true
            path << '/Dropbox-Uploader'

            if File.directory?(path)
              CliMessage.warning("Using pre-existing Dropbox Uploader at #{ path }...")
            else
              CliMessage.info_block("Downloading Dropbox Uploader to #{ path }...", 'Done.', true) do
                system "git clone https://github.com/andreafabrizi/Dropbox-Uploader.git #{ path }"
              end
            end

            Configuration.add_section('db_uploader')
            Configuration['db_uploader'].merge!('local_filepath' => path)
          else<commit_msg>Added automatic Dropbox Uploader configuration<commit_after>module SifttterRedux
  #  ======================================================
  #  DBU Module
  #
  #  Wrapper module for the Dropbox Uploader project
  #  ======================================================
  module DBU
    CONFIG_FILEPATH = File.join(ENV['HOME'], '.dropbox_uploader')
    DEFAULT_MESSAGE = 'RUNNING DROPBOX UPLOADER'

    #  ----------------------------------------------------
    #  download method
    #
    #  Downloads the files at the remote Dropbox filepath
    #  to a filepath on the local filesystem.
    #  @return Void
    #  ----------------------------------------------------
    def self.download
      if !@local_path.nil? && !@remote_path.nil?
        CliMessage.info_block(@message ||= DEFAULT_MESSAGE, 'Done.', SifttterRedux.verbose) do
          if SifttterRedux.verbose
            system "#{ @dbu } download #{ @remote_path } #{ @local_path }"
          else
            exec = `#{ @dbu } download #{ @remote_path } #{ @local_path }`
          end
        end
      else
        fail ArgumentError, 'Local and remote DBU targets cannot be nil'
      end
    end

    #  ----------------------------------------------------
    #  install_wizard method
    #
    #  Runs a wizard that installs Dropbox Uploader on the
    #  local filesystem.
    #  @return Void
    #  ----------------------------------------------------
    def self.install_wizard
      valid_directory_chosen = false

      CliMessage.section_block('CONFIGURING DROPBOX UPLOADER...') do
        until valid_directory_chosen
          # Prompt the user for a location to save Dropbox Uploader. '
          path = CliMessage.prompt('Location for Dropbox-Uploader', DBU_LOCAL_FILEPATH)
          path.chop! if path.end_with?('/')
          path = '/usr/local/opt' if path.empty?

          # If the entered directory exists, clone the repository.
          if File.directory?(path)
            valid_directory_chosen = true
            path << '/Dropbox-Uploader'

            if File.directory?(path)
              CliMessage.warning("Using pre-existing Dropbox Uploader at #{ path }...")
            else
              CliMessage.info_block("Downloading Dropbox Uploader to #{ path }...", 'Done.', true) do
                system "git clone https://github.com/andreafabrizi/Dropbox-Uploader.git #{ path }"
              end
            end
            
            # If the user has never configured Dropbox Uploader, have them do it here.
            system "#{ @dbu }" unless File.exists?(CONFIG_FILEPATH)

            Configuration.add_section('db_uploader')
            Configuration['db_uploader'].merge!('local_filepath' => path)
          else
{'fraction_non_alphanumeric': 0.203778677462888, 'fraction_numerical': 0.0, 'mean_word_length': 1.744973544973545, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5184712', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1349, 'n_words': 351}