<commit_before>require "rubygems_check_replacement_vulnerability"
require "thor"

module RubygemsCheckReplacementVulnerability
  require "yaml"
  require "json"

  class CLI < Thor
    include ShellMethods

    desc "version", "Show version"
    def version
      puts RubygemsCheckReplacementVulnerability::VERSION
    end

    desc "vulnerable_gems", "Show vulnerable gems"
    option :username, aliases: "u", desc: "Username of rubygems.org", required: true
    option :format, aliases: "f", desc: "Print format (plain, yaml, json)", default: "plain"
    def vulnerable_gems
      gems = Rubygems.owner_gems(options[:username]).select { |gem| gem.include?("-") }.sort

      vulnerable_gems =
        gems.each_with_object({}) do |gem, result|
          rubygems = Rubygems.new(gem)
          versions = rubygems.vulnerable_versions
          result[gem] = versions unless versions.empty?
        end

      case options[:format]
      when "plain"
        puts "#{options[:username]}'s vulnerable gems"
<commit_msg>Fix. uninitialized constant<commit_after>require "rubygems_check_replacement_vulnerability"
require "thor"

module RubygemsCheckReplacementVulnerability
  require "yaml"
  require "json"
  require "pathname"

  class CLI < Thor
    include ShellMethods

    desc "version", "Show version"
    def version
      puts RubygemsCheckReplacementVulnerability::VERSION
    end

    desc "vulnerable_gems", "Show vulnerable gems"
    option :username, aliases: "u", desc: "Username of rubygems.org", required: true
    option :format, aliases: "f", desc: "Print format (plain, yaml, json)", default: "plain"
    def vulnerable_gems
      gems = Rubygems.owner_gems(options[:username]).select { |gem| gem.include?("-") }.sort

      vulnerable_gems =
        gems.each_with_object({}) do |gem, result|
          rubygems = Rubygems.new(gem)
          versions = rubygems.vulnerable_versions
          result[gem] = versions unless versions.empty?
        end

      case options[:format]
      when "plain"
        puts "#{options[:username]}'s vulnerable gems"

{'fraction_non_alphanumeric': 0.10467920887602508, 'fraction_numerical': 0.0, 'mean_word_length': 3.5283842794759823, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1455811', 'n_tokens_mistral': 642, 'n_tokens_neox': 622, 'n_words': 164}