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

require 'bundler/setup'
require 'date'
require 'faraday'

domain = 'https://www.pensionwise.gov.uk'
pages = %w(
  /
  /6-steps-you-need-to-take
  /already-bought-annuity
  /appointments
  /benefits
  /contact
  /cookies
  /cymraeg
  /divorce
  /living-abroad
  /making-money-last
  /pension-complaints
  /pension-pot-options
  /pension-pot-value
  /pension-types
  /scams
  /shop-around
  /tax
  /when-you-die
  /work-out-income
)

puts ">> Checking #{domain} at #{Time.now}"

conn = Faraday.new(domain)

for page in pages do
  puts page
  response = conn.get(page)

  unless DateTime.parse(response.headers['expires']).to_time > Time.now
    raise "Expires at #{response.headers['expires']}"
  end
end

puts '>> OK'<commit_msg>Check production pages are 200 OK<commit_after>#!/usr/bin/env ruby

require 'bundler/setup'
require 'date'
require 'faraday'

domain = 'https://www.pensionwise.gov.uk'
pages = %w(
  /
  /6-steps-you-need-to-take
  /already-bought-annuity
  /appointments
  /benefits
  /contact
  /cookies
  /cymraeg
  /divorce
  /living-abroad
  /making-money-last
  /pension-complaints
  /pension-pot-options
  /pension-pot-value
  /pension-types
  /scams
  /shop-around
  /tax
  /when-you-die
  /work-out-income
)

puts ">> Checking #{domain} at #{Time.now}"

conn = Faraday.new(domain)

for page in pages do
  puts page
  response = conn.get(page)

  unless response.status == 200
    raise "Status code was #{response.status}"
  end

  unless DateTime.parse(response.headers['expires']).to_time > Time.now
    raise "Expires at #{response.headers['expires']}"
  end
end

puts '>> OK'
{'fraction_non_alphanumeric': 0.1438188494492044, 'fraction_numerical': 0.004895960832313341, 'mean_word_length': 3.1603053435114505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7363154', 'n_tokens_mistral': 656, 'n_tokens_neox': 626, 'n_words': 129}