<commit_before>#bundle exec ruby app.rb 
require 'bundler/setup'
require 'sinatra'
require 'erb'
require 'haml'
require 'deface'
require 'deface/haml_converter' #is conditionally loaded by deface
require 'coderay'
require 'json'
require 'nokogiri'
require 'rspec/mocks'
# require 'ruby-debug/debugger'

RSpec::Mocks::setup(self)
Rails = mock 'Rails'
Rails.stub :application => mock('application')
Rails.application.stub :config => mock('config')
Rails.application.config.stub :cache_classes => true
Rails.application.config.stub :deface => ActiveSupport::OrderedOptions.new
Rails.application.config.stub :deface => Deface::Environment.new
Rails.stub(:logger)

get '/' do
  erb :index
end

post '/deface' do
  html_highlighter = CodeRay::Duo[:html, :div]
  xml_highlighter = CodeRay::Duo[:xml, :div]
  ruby_highlighter = CodeRay::Duo[:rhtml, :div]<commit_msg>Stub info and error logger methods<commit_after>#bundle exec ruby app.rb 
require 'bundler/setup'
require 'sinatra'
require 'erb'
require 'haml'
require 'deface'
require 'deface/haml_converter' #is conditionally loaded by deface
require 'coderay'
require 'json'
require 'nokogiri'
require 'rspec/mocks'
# require 'ruby-debug/debugger'

RSpec::Mocks::setup(self)
Rails = mock 'Rails'
Rails.stub :application => mock('application')
Rails.application.stub :config => mock('config')
Rails.application.config.stub :cache_classes => true
Rails.application.config.stub :deface => ActiveSupport::OrderedOptions.new
Rails.application.config.stub :deface => Deface::Environment.new
Rails.stub(:logger)
Rails.logger.stub(:info)
Rails.logger.stub(:error)

get '/' do
  erb :index
end

post '/deface' do
  html_highlighter = CodeRay::Duo[:html, :div]
  xml_highlighter = CodeRay::Duo[:xml, :div]
  ruby_highlighter = CodeRay::Duo[:rhtml, :div]
{'fraction_non_alphanumeric': 0.13870246085011187, 'fraction_numerical': 0.0, 'mean_word_length': 6.516806722689076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5332165', 'n_tokens_mistral': 627, 'n_tokens_neox': 635, 'n_words': 142}