<commit_before>require 'travis/cli'
require 'gh'

module Travis
  module CLI
    class RepoCommand < ApiCommand
      GIT_REGEX = %r{Fetch URL: (?:https://|git://|git@)github\.com[:/](.*/.+?)(\.git)?$}
      on('-r', '--repo SLUG') { |c| c.slug = slug }

      attr_accessor :slug
      abstract

      def setup
        error "Can't figure out GitHub repo name. Are you in the right directory?" unless self.slug ||= find_slug
        self.api_endpoint = detect_api_endpoint
        super
      end

      def repository
        repo(slug)
      rescue Travis::Client::NotFound
        error "repository not known to travis: #{color(slug, :important)}"
      end

      private

        def find_slug
          git_info = `git remote show origin 2>&1`
          $1 if git_info =~ GIT_REGEX
        end

        def repo_config
          config['repos'] ||= {}
          config['repos'][slug] ||= {}<commit_msg>add detected_endpoint? to repo commands, so --org will be added to command suggestions when needed<commit_after>require 'travis/cli'
require 'gh'

module Travis
  module CLI
    class RepoCommand < ApiCommand
      GIT_REGEX = %r{Fetch URL: (?:https://|git://|git@)github\.com[:/](.*/.+?)(\.git)?$}
      on('-r', '--repo SLUG') { |c| c.slug = slug }

      attr_accessor :slug
      abstract

      def setup
        error "Can't figure out GitHub repo name. Are you in the right directory?" unless self.slug ||= find_slug
        self.api_endpoint = detect_api_endpoint
        super
      end

      def repository
        repo(slug)
      rescue Travis::Client::NotFound
        error "repository not known to travis: #{color(slug, :important)}"
      end

      private

        def detected_endpoint?
          !explicit_api_endpoint?
        end

        def find_slug
          git_info = `git remote show origin 2>&1`
          $1 if git_info =~ GIT_REGEX
        end

        def repo_config
          config['repos'] ||= {}
          config['repos'][slug] ||= {}
{'fraction_non_alphanumeric': 0.12355017650025214, 'fraction_numerical': 0.0030257186081694403, 'mean_word_length': 2.189710610932476, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4601393', 'n_tokens_mistral': 617, 'n_tokens_neox': 603, 'n_words': 174}