<commit_before>require 'sinatra'
require 'yaml'
$LOAD_PATH << 'lib'
require 'go_watchdog'

raise "Must supply Go username in env variable GO_USERNAME" unless ENV['GO_USERNAME']
raise "Must supply Go password in env variable GO_PASSWORD" unless ENV['GO_PASSWORD']

set :public_folder, File.dirname(__FILE__) + '/static'

def config
  YAML.load(File.read('config.yml'))
end

get '/' do
    erb :index, :locals => { :watchdog => GoWatchdog.new(config) }
end

get '/time' do
  osito = GoWatchdog.new(config)
<<-JAVASCRIPT
 $("#time_since_last_green_build").text('#{osito.time_since_last_green_build}');
 $('body').removeClass('happy neutral angry');
 $('body').addClass('#{osito.mood}');
JAVASCRIPT
end<commit_msg>removed unnecessary local to template<commit_after>require 'sinatra'
require 'yaml'
$LOAD_PATH << 'lib'
require 'go_watchdog'

raise "Must supply Go username in env variable GO_USERNAME" unless ENV['GO_USERNAME']
raise "Must supply Go password in env variable GO_PASSWORD" unless ENV['GO_PASSWORD']

set :public_folder, File.dirname(__FILE__) + '/static'

def config
  YAML.load(File.read('config.yml'))
end

get '/' do
    erb :index
end

get '/time' do
  osito = GoWatchdog.new(config)
<<-JAVASCRIPT
 $("#time_since_last_green_build").text('#{osito.time_since_last_green_build}');
 $('body').removeClass('happy neutral angry');
 $('body').addClass('#{osito.mood}');
JAVASCRIPT
end
{'fraction_non_alphanumeric': 0.15229885057471265, 'fraction_numerical': 0.0, 'mean_word_length': 6.293193717277487, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '6362108', 'n_tokens_mistral': 490, 'n_tokens_neox': 474, 'n_words': 118}