<commit_before>class DtfSetup < Thor

  desc "install", "installs database schemas and control scripts"
  method_options :force => :boolean
  def install(name= "*")
    puts "installing db schemas and control scripts"
    Dir["db/migrations/#{name}"].each do |source|
      destination = "db/migrations/#{File.basename(source)}"
      FileUtils.rm(destination) if options[:force] && File.exist?(destination)
      if File.exist?(destination)
        puts "Skipping #{destination} because it already exists"
      else
        puts "Generating #{destination}"
        FileUtils.cp(source, destination)
      end
    end
  end

  desc "config [NAME]", "copy db configuration file(s)"
  method_options :force => :boolean
  def config(name = "*")
    Dir["examples/config/#{name}"].each do |source|
      destination = "config/#{File.basename(source)}"
      FileUtils.rm(destination) if options[:force] && File.exist?(destination)
      if File.exist?(destination)
        puts "Skipping #{destination} because it already exists"
      else
        puts "Generating #{destination}"
        FileUtils.cp(source, destination)
      end
    end
  end

end<commit_msg>Added directory logic to the thor install and config options because the copy operatins are copying files relative to the gem to places relative to the user's project, so the paths have to change.<commit_after>class DtfSetup < Thor

  desc "install", "installs database schemas and control scripts"
  method_options :force => :boolean
  def install(name= "*")
    puts "installing db schemas and control scripts"

    # The gem is installed elsewhere so the copy path needs to be
    # relative to the gem, not the user.
    curr_dir = File.dirname(__FILE__)

    Dir["#{curr_dir}/../../db/migrations/#{name}"].each do |source|

      # Use File.basename to remove the gem's path info so we can
      # use just the filename to copy relative to the user.
      destination = "db/migrations/#{File.basename(source)}"

      FileUtils.rm(destination) if options[:force] && File.exist?(destination)
      if File.exist?(destination)
        puts "Skipping #{destination} because it already exists"
      else
        puts "Generating #{destination}"
        FileUtils.cp(source, destination)
      end
    end
  end

  desc "config [NAME]", "copy db configuration file(s)"
  method_options :force => :boolean
  def config(name = "*")

    # The gem is installed elsewhere so the copy path needs to be
    # relative to the gem, not the user.
    curr_dir = File.dirname(__FILE__)

    Dir["#{curr_dir}/../../examples/config/#{name}"].each do |source|

      # Use File.basename to remove the gem's path info so we can
      # use just the filename to copy relative to the user.
      destination = "config/#{File.basename(source)}"

      FileUtils.rm(destination) if options[:force] && File.exist?(destination)
      if File.exist?(destination)
        puts "Skipping #{destination} because it already exists"
      else
        puts "Generating #{destination}"
        FileUtils.cp(source, destination)
      end
    end
  end

end
{'fraction_non_alphanumeric': 0.10967324490456164, 'fraction_numerical': 0.0, 'mean_word_length': 3.1953867028493894, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4970374', 'n_tokens_mistral': 855, 'n_tokens_neox': 863, 'n_words': 296}