<commit_before>module Tmuxinator
  class Cli < Thor
    include Tmuxinator::Util

    package_name "tmuxinator"

    desc "new [PROJECT]", "Create a new project file and open it in your editor"
    map "open" => :new
    map "o" => :new
    map "n" => :new

    def new(name)
      config = Tmuxinator::Config.project(name)

      unless Tmuxinator::Config.exists?(name)
        template = Tmuxinator::Config.default? ? Tmuxinator::Config.default : Tmuxinator::Config.sample
        erb  = ERB.new(File.read(template)).result(binding)
        File.open(config, "w") { |f| f.write(erb) }
      end

      Kernel.system("$EDITOR #{config}")
    end

    desc "start [PROJECT]", "Start a tmux session using a project's tmuxinator config"
    map "s" => :start

    def start(name)
      exit!("Project #{name} doesn't exist.") unless Tmuxinator::Config.exists?(name)

      config = Tmuxinator::Config.project(name)
      tmux = Tmuxinator::Project.new(File.read(config)).render
<commit_msg>Pass the file, not the contents to the project class.<commit_after>module Tmuxinator
  class Cli < Thor
    include Tmuxinator::Util

    package_name "tmuxinator"

    desc "new [PROJECT]", "Create a new project file and open it in your editor"
    map "open" => :new
    map "o" => :new
    map "n" => :new

    def new(name)
      config = Tmuxinator::Config.project(name)

      unless Tmuxinator::Config.exists?(name)
        template = Tmuxinator::Config.default? ? Tmuxinator::Config.default : Tmuxinator::Config.sample
        erb  = ERB.new(File.read(template)).result(binding)
        File.open(config, "w") { |f| f.write(erb) }
      end

      Kernel.system("$EDITOR #{config}")
    end

    desc "start [PROJECT]", "Start a tmux session using a project's tmuxinator config"
    map "s" => :start

    def start(name)
      exit!("Project #{name} doesn't exist.") unless Tmuxinator::Config.exists?(name)

      config = Tmuxinator::Config.project(name)
      tmux = Tmuxinator::Project.new(File.open(config)).render

{'fraction_non_alphanumeric': 0.1359126984126984, 'fraction_numerical': 0.0, 'mean_word_length': 3.2642706131078225, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1962954', 'n_tokens_mistral': 649, 'n_tokens_neox': 632, 'n_words': 167}