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

require 'net/https'
require 'uri'

ENVIRONMENTS = {
    'dev' => 'dev-adp.dsd.io',
    'sandbox' => 'api-sandbox-adp.dsd.io',
    'staging' => 'staging-adp.dsd.io',
    'production' => 'claim-crown-court-defence.service.gov.uk'
}

def hostname
  @hostname ||= (ENVIRONMENTS[ARGV[0]] || (raise 'Please specify the environment (%s) as the first argument' % ENVIRONMENTS.keys.join(',')))
end

def uri
  @uri ||= URI.parse("https://#{hostname}/ping.json")
end

def output(msg)
  puts '(%s) %s' % [Time.now.strftime('%H:%M:%S'), msg]
end

begin
  puts
  puts 'Checking %s | Ctrl+C to stop and exit' % uri
  puts

  status, timestamp = 200, Time.now<commit_msg>Update old host domain references<commit_after>#!/usr/bin/env ruby

require 'net/https'
require 'uri'

ENVIRONMENTS = {
    'dev' => 'dev.claim-crown-court-defence.service.justice.gov.uk',
    'sandbox' => 'api-sandbox.claim-crown-court-defence.service.justice.gov.uk',
    'staging' => 'staging.claim-crown-court-defence.service.justice.gov.uk',
    'production' => 'claim-crown-court-defence.service.gov.uk'
}

def hostname
  @hostname ||= (ENVIRONMENTS[ARGV[0]] || (raise 'Please specify the environment (%s) as the first argument' % ENVIRONMENTS.keys.join(',')))
end

def uri
  @uri ||= URI.parse("https://#{hostname}/ping.json")
end

def output(msg)
  puts '(%s) %s' % [Time.now.strftime('%H:%M:%S'), msg]
end

begin
  puts
  puts 'Checking %s | Ctrl+C to stop and exit' % uri
  puts

  status, timestamp = 200, Time.now
{'fraction_non_alphanumeric': 0.18931398416886544, 'fraction_numerical': 0.005277044854881266, 'mean_word_length': 4.02317880794702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5749098', 'n_tokens_mistral': 610, 'n_tokens_neox': 597, 'n_words': 123}