<commit_before>require 'sinatra/base'
require 'sinatra/json'
require 'json'
require 'yaml'
require 'haml'
require 'logger'
require 'tilt/haml'
require 'rack-flash'
require 'omniauth_crowd'
require 'omniauth'
require 'nagios_rest_api/email_client'
require 'nagios_rest_api/version'
require 'nagios_rest_api/domain'
require 'nagios_rest_api/client'
require 'nagios_rest_api/interface'
require 'nagios_rest_api/hosts'
require 'nagios_rest_api/host_groups'
require 'nagios_rest_api/services'
require 'nagios_rest_api/helpers'

class RestApi < Sinatra::Application
  include NagiosRestApi::EmailClient

  helpers do
      include Rack::Utils
  end
  
  helpers NagiosRestApi::Helpers
#=begin 
  use OmniAuth::Builder do
    provider :crowd, :crowd_server_url => "https://crowd.unbelievable-machine.net", :application_name => "nagios-rest-api", :application_password => "<PASSWORD>="
  end 

  OmniAuth.config.on_failure = Proc.new { |env|
    OmniAuth::FailureEndpoint.new(env).redirect_to_failure
  }
#=end
  
  TEN_MB = 10490000
  Logger.class_eval { alias :write :<< }
  log_dir = File.expand_path("../../log",__FILE__)
  Dir.mkdir log_dir unless File.exists? log_dir
  app_log = File.join(log_dir, 'application.log' )<commit_msg>obfuscate<commit_after>require 'sinatra/base'
require 'sinatra/json'
require 'json'
require 'yaml'
require 'haml'
require 'logger'
require 'tilt/haml'
require 'rack-flash'
require 'omniauth_crowd'
require 'omniauth'
require 'nagios_rest_api/email_client'
require 'nagios_rest_api/version'
require 'nagios_rest_api/domain'
require 'nagios_rest_api/client'
require 'nagios_rest_api/interface'
require 'nagios_rest_api/hosts'
require 'nagios_rest_api/host_groups'
require 'nagios_rest_api/services'
require 'nagios_rest_api/helpers'

class RestApi < Sinatra::Application
  include NagiosRestApi::EmailClient

  helpers do
      include Rack::Utils
  end
  
  helpers NagiosRestApi::Helpers
#=begin 
  use OmniAuth::Builder do
    provider :crowd, :crowd_server_url => "https://", :application_name => "nagios-rest-api", :application_password => ""
  end 

  OmniAuth.config.on_failure = Proc.new { |env|
    OmniAuth::FailureEndpoint.new(env).redirect_to_failure
  }
#=end
  
  TEN_MB = 10490000
  Logger.class_eval { alias :write :<< }
  log_dir = File.expand_path("../../log",__FILE__)
  Dir.mkdir log_dir unless File.exists? log_dir
  app_log = File.join(log_dir, 'application.log' )
{'fraction_non_alphanumeric': 0.11779344670261302, 'fraction_numerical': 0.006636250518457071, 'mean_word_length': 5.590163934426229, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '1512999', 'n_tokens_mistral': 902, 'n_tokens_neox': 865, 'n_words': 165}