<commit_before>require 'git'
require 'singleton'
require 'fileutils'

module TransitlandClient
  class FeedRegistry
    include Singleton

    def self.repo(force_update: false)
      @remote_url ||= ENV['TRANSITLAND_FEED_REGISTRY_URL'] || 'git<EMAIL>:transitland/transitland-feed-registry.git'
      @local_path ||= ENV['TRANSITLAND_FEED_REGISTRY_PATH'] || File.join(__dir__, '..', '..','tmp', 'transitland-feed-registry')

      if !defined?(@repo) || force_update
        begin
          FileUtils.mkdir_p(@local_path)

          @repo = Git.open(@local_path)
          @repo.pull if force_update
        rescue ArgumentError => error
          if error.message == 'path does not exist'
            @repo = Git.clone(@remote_url, @local_path)
          end
        end
      end

      @repo<commit_msg>checkout git repo over HTTP (rather than SSH)<commit_after>require 'git'
require 'singleton'
require 'fileutils'

module TransitlandClient
  class FeedRegistry
    include Singleton

    def self.repo(force_update: false)
      @remote_url ||= ENV['TRANSITLAND_FEED_REGISTRY_URL'] || 'https://github.com/transitland/transitland-feed-registry.git'
      @local_path ||= ENV['TRANSITLAND_FEED_REGISTRY_PATH'] || File.join(__dir__, '..', '..','tmp', 'transitland-feed-registry')

      if !defined?(@repo) || force_update
        begin
          FileUtils.mkdir_p(@local_path)

          @repo = Git.open(@local_path)
          @repo.pull if force_update
        rescue ArgumentError => error
          if error.message == 'path does not exist'
            @repo = Git.clone(@remote_url, @local_path)
          end
        end
      end

      @repo
{'fraction_non_alphanumeric': 0.12106537530266344, 'fraction_numerical': 0.0, 'mean_word_length': 2.8985849056603774, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 1, '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': '917850', 'n_tokens_mistral': 534, 'n_tokens_neox': 514, 'n_words': 104}