<commit_before>require 'sinatra'
require 'json'

get "/" do 
  "Avaliable API's <br/> 
  /env <br/> 
  /ls/:dir"
end

get "/env" do
  output = "<pre>"
  output += JSON.pretty_generate(ENV.to_hash)
  output += "</pre>"
  output
end

get "/ls/:dir" do
  dir = "/" +  params[:dir]
  
  output = "<pre>"
  Dir.entries(dir).each do |d| 
    output += d + "<br/>"
  end rescue return 404
  output += "</pre>"
end

get "/cat/*" do 
  f = "/" +  params[:splat].first
  puts "Catting #{f}"
  output = "<pre>"
  output += `cat #{f}`
  output += "</pre>"
end
<commit_msg>Remove cat option that never worked very well<commit_after>require 'sinatra'
require 'json'

get "/" do 
  "Avaliable API's <br/> 
  /env <br/> 
  /ls/:dir"
end

get "/env" do
  output = "<pre>"
  output += JSON.pretty_generate(ENV.to_hash)
  output += "</pre>"
  output
end

get "/ls/:dir" do
  dir = "/" +  params[:dir]
  
  output = "<pre>"
  Dir.entries(dir).each do |d| 
    output += d + "<br/>"
  end rescue return 404
  output += "</pre>"
end


{'fraction_non_alphanumeric': 0.2015810276679842, 'fraction_numerical': 0.005928853754940711, 'mean_word_length': 2.738007380073801, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1823227', 'n_tokens_mistral': 408, 'n_tokens_neox': 393, 'n_words': 111}