<commit_before>require_relative './version'

# Mix this module into the main application module to provide
# information about the current version, latest version,
# and whether the app is up-to-date.
#
# In config/application.rb:
#
#     module OneBody
#       extend VersionInfo
#     end
#
module VersionInfo
  GITHUB_REPO_OWNER = 'churchio'.freeze
  GITHUB_REPO_NAME = 'onebody'.freeze

  def current_version
    @current_version ||= Version.from_string(current_version_string)
  end

  def latest_version
    string = Rails.cache.fetch('latest_version', expires_in: 1.hour) do
      Github.repos.releases.all(GITHUB_REPO_OWNER, GITHUB_REPO_NAME).first['tag_name']
    end
    Version.from_string(string)
  rescue Github::Error::ServiceError, Faraday::ConnectionFailed
    nil
  end

  def up_to_date?
    current_version >= latest_version
  end
<commit_msg>Fix repo owner in version check<commit_after>require_relative './version'

# Mix this module into the main application module to provide
# information about the current version, latest version,
# and whether the app is up-to-date.
#
# In config/application.rb:
#
#     module OneBody
#       extend VersionInfo
#     end
#
module VersionInfo
  GITHUB_REPO_OWNER = 'seven1m'.freeze
  GITHUB_REPO_NAME = 'onebody'.freeze

  def current_version
    @current_version ||= Version.from_string(current_version_string)
  end

  def latest_version
    string = Rails.cache.fetch('latest_version', expires_in: 1.hour) do
      Github.repos.releases.all(GITHUB_REPO_OWNER, GITHUB_REPO_NAME).first['tag_name']
    end
    Version.from_string(string)
  rescue Github::Error::ServiceError, Faraday::ConnectionFailed
    nil
  end

  def up_to_date?
    current_version >= latest_version
  end

{'fraction_non_alphanumeric': 0.08500861573808156, 'fraction_numerical': 0.0017231476163124641, 'mean_word_length': 4.246987951807229, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5730896', 'n_tokens_mistral': 576, 'n_tokens_neox': 552, 'n_words': 133}