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

def header(title)
  puts ""
  puts title
  puts "=" * 20
end

class Route < Struct.new(:method, :path)
  include Comparable
  def to_s
    "#{method.upcase} #{path}"
  end

  def <=> other
    path <=> other.path
  end
end

routes = `rake routes`.split("\n").map { |line|
  match = line.match(/(\w+) +(\/[^( ]+)/)
  match && Route.new(match[1].downcase, match[2])
}.compact

header "Routes"
routes.each { |r| puts r }

existing_docs = `egrep -Rh "^\\W*(post|put|get|delete)" spec/acceptance`.split("\n").map { |line|
  match = line.match(/(\w+) +['"](\S+)['"]/)<commit_msg>Change missing_docs script to use bundle exec for its rake<commit_after>#!/usr/bin/env ruby

def header(title)
  puts ""
  puts title
  puts "=" * 20
end

class Route < Struct.new(:method, :path)
  include Comparable
  def to_s
    "#{method.upcase} #{path}"
  end

  def <=> other
    path <=> other.path
  end
end

routes = `bundle exec rake routes`.split("\n").map { |line|
  match = line.match(/(\w+) +(\/[^( ]+)/)
  match && Route.new(match[1].downcase, match[2])
}.compact

header "Routes"
routes.each { |r| puts r }

existing_docs = `egrep -Rh "^\\W*(post|put|get|delete)" spec/acceptance`.split("\n").map { |line|
  match = line.match(/(\w+) +['"](\S+)['"]/)
{'fraction_non_alphanumeric': 0.2211764705882353, 'fraction_numerical': 0.006274509803921568, 'mean_word_length': 3.524822695035461, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4588895', 'n_tokens_mistral': 506, 'n_tokens_neox': 495, 'n_words': 114}