<commit_before>require 'chronic'

class PageReview
  attr_reader :page

  def initialize(page)
    @page = page
  end

  def reviewable?
    page.data.review_in.present?
  end

  def owner_slack
    page.data.owner_slack
  end

  def owner_slack_url
    # Slack URLs don't have the # (channels) or @ (usernames)
    slack_identifier = owner_slack.gsub('#', '').gsub('@', '')
    "https://govuk.slack.com/messages/#{slack_identifier}"
  end

  def expired?
    reviewable? && Date.today > review_by
  end

  def expiring_soon?<commit_msg>Use "delete" instead of "gsub"<commit_after>require 'chronic'

class PageReview
  attr_reader :page

  def initialize(page)
    @page = page
  end

  def reviewable?
    page.data.review_in.present?
  end

  def owner_slack
    page.data.owner_slack
  end

  def owner_slack_url
    # Slack URLs don't have the # (channels) or @ (usernames)
    slack_identifier = owner_slack.delete('#').delete('@')
    "https://govuk.slack.com/messages/#{slack_identifier}"
  end

  def expired?
    reviewable? && Date.today > review_by
  end

  def expiring_soon?
{'fraction_non_alphanumeric': 0.1140754369825207, 'fraction_numerical': 0.0, 'mean_word_length': 3.4048582995951415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4074225', 'n_tokens_mistral': 405, 'n_tokens_neox': 382, 'n_words': 86}