<commit_before>#! /usr/bin/env ruby

require "thor"
require "yaml"

class Monk < Thor
  include Thor::Actions

  [:skip, :pretend, :force, :quiet].each do |task|
    class_options.delete task
  end

  desc "init NAME [--skeleton SHORTHAND|URL]", "Initialize a Monk application"
  method_option :skeleton, :type => :string, :aliases => "-s"
  def init(target)
    ensure_rvm
    clone(target)
    cleanup(target)
    create_rvmrc(target)
  end

  desc "install --clean", "Install all dependencies."
  method_option :clean, :type => :boolean
  def install(manifest = ".gems")
    run("rvm rvmrc load")
    run("rvm --force gemset empty") if options.clean?

    File.readlines(manifest).each do |gem|
      `gem install #{gem}`
    end
  end

  desc "lock", "Lock the current dependencies to the gem manifest file."
  def lock
    run("rvm gemset export .gems")
  end

  desc "unpack", "Freeze the current dependencies."
  def unpack
    run("rvm gemset unpack")
  end

  desc "show NAME", "Display the repository address for NAME"
  def show(name)
    say_status name, source(name) || "repository not found"
  end

  desc "list", "Lists the configured repositories"
  def list
    monk_config.keys.sort.each do |key|
      show(key)
    end<commit_msg>Ensure the project gemset is loaded before locking.<commit_after>#! /usr/bin/env ruby

require "thor"
require "yaml"

class Monk < Thor
  include Thor::Actions

  [:skip, :pretend, :force, :quiet].each do |task|
    class_options.delete task
  end

  desc "init NAME [--skeleton SHORTHAND|URL]", "Initialize a Monk application"
  method_option :skeleton, :type => :string, :aliases => "-s"
  def init(target)
    ensure_rvm
    clone(target)
    cleanup(target)
    create_rvmrc(target)
  end

  desc "install --clean", "Install all dependencies."
  method_option :clean, :type => :boolean
  def install(manifest = ".gems")
    run("rvm rvmrc load")
    run("rvm --force gemset empty") if options.clean?

    File.readlines(manifest).each do |gem|
      `gem install #{gem}`
    end
  end

  desc "lock", "Lock the current dependencies to the gem manifest file."
  def lock
    run("rvm rvmrc load")
    run("rvm gemset export .gems")
  end

  desc "unpack", "Freeze the current dependencies."
  def unpack
    run("rvm gemset unpack")
  end

  desc "show NAME", "Display the repository address for NAME"
  def show(name)
    say_status name, source(name) || "repository not found"
  end

  desc "list", "Lists the configured repositories"
  def list
    monk_config.keys.sort.each do |key|
      show(key)
    end
{'fraction_non_alphanumeric': 0.11817472698907956, 'fraction_numerical': 0.0, 'mean_word_length': 3.392123287671233, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '444794', 'n_tokens_mistral': 864, 'n_tokens_neox': 821, 'n_words': 277}