<commit_before>require "thor"
require "yaml"
require "taco"
## Todo: Don't forget say_status, etc

class TacoTruck < Thor
  include Thor::Actions

  add_runtime_options!

  class_option :environment, :type => :string, :aliases => "-e"

  # ./bin/taco hello --who yous -m "How are you?"
  desc "hello", "A Hello World method for debugging"
  method_option :who,     :type => :string, :aliases => "-w"
  method_option :message, :type => :string, :aliases => "-m"
  def hello
    puts "Hello #{options[:who]}!!"
    unless options[:message].nil?
      puts "Also, #{options[:message]}"
    end
  end

  desc "install", "Install the Tacofiles"
  def install
    unless File.directory?(taco_dir)
      Dir.mkdir(taco_dir)
      File.open(taco_file, "w")
    end
  end

  desc "add", "Register a git URI"
  method_option :uri,     :type => :string, :aliases => "-u"
  def add
    puts "Registering..."

    raise "Error: Please provide all arguments" if options[:uri].nil?
    raise "Error: URI must be of a valid git repository" unless options[:uri].match(/^git:\/\//)

    append_file taco_file, "\n#{parse_git(options[:uri]).join("|")}"

    puts "Registered!"
  end

  desc "list", "List all registered Tacos"
  def list
    puts "Listing Tacos..."
    file = File.read(taco_file)
    file.each_line do |line|
      attributes = line.split("|")
      puts attributes.join("  |  ")
    end
    puts "No Tacos present" if file == ""
  end

protected
  def parse_git(uri)
    Taco.woop
    # TODO: For now, actually grabbing git needs to be done but is more complex, so pointing to the Github file will suffice for now.
    parse_git_file(uri)
    ["Yay", "It Works", "It really works"]
  end

  def parse_git_file(uri)
    inside(taco_tmp_dir) do
      clone = run "git clone #{uri}"
    end
  end

  GIT_NAME_FROM_URL = /git:\/\/.*.\/(.*).git/
  def self.git_name_from_repo(uri)
    match = uri.match(GIT_NAME_FROM_URL)
    if match.nil?
      raise "Please provide a valid git URI"
    else
      match[1]
    end
  end
<commit_msg>Removing dev code<commit_after>require "thor"
require "yaml"
require "taco"
## Todo: Don't forget say_status, etc

class TacoTruck < Thor
  include Thor::Actions

  add_runtime_options!

  class_option :environment, :type => :string, :aliases => "-e"

  desc "install", "Install the Tacofiles"
  def install
    unless File.directory?(taco_dir)
      Dir.mkdir(taco_dir)
      File.open(taco_file, "w")
    end
  end

  desc "add", "Register a git URI"
  method_option :uri,     :type => :string, :aliases => "-u"
  def add
    puts "Registering..."

    raise "Error: Please provide all arguments" if options[:uri].nil?
    raise "Error: URI must be of a valid git repository" unless options[:uri].match(/^git:\/\//)

    append_file taco_file, "\n#{parse_git(options[:uri]).join("|")}"

    puts "Registered!"
  end

  desc "list", "List all registered Tacos"
  def list
    puts "Listing Tacos..."
    file = File.read(taco_file)
    file.each_line do |line|
      attributes = line.split("|")
      puts attributes.join("  |  ")
    end
    puts "No Tacos present" if file == ""
  end

protected
  def parse_git(uri)
    # TODO: For now, actually grabbing git needs to be done but is more complex, so pointing to the Github file will suffice for now.
    parse_git_file(uri)
    ["Yay", "It Works", "It really works"]
  end

  def parse_git_file(uri)
    inside(taco_tmp_dir) do
      clone = run "git clone #{uri}"
    end
  end

  GIT_NAME_FROM_URL = /git:\/\/.*.\/(.*).git/
  def self.git_name_from_repo(uri)
    match = uri.match(GIT_NAME_FROM_URL)
    if match.nil?
      raise "Please provide a valid git URI"
    else
      match[1]
    end
  end

{'fraction_non_alphanumeric': 0.1339479392624729, 'fraction_numerical': 0.0005422993492407809, 'mean_word_length': 2.992424242424242, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3171053', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1262, 'n_words': 387}